Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Net::SMTP_auth

by watcher@LBK (Initiate)
on Nov 06, 2005 at 12:39 UTC ( #506104=note: print w/replies, xml ) Need Help??


in reply to Net::SMTP_auth

I tried it with the following code (look behind the output), but I keep getting following output:
C:\Documents and Settings\Isabelle\Bureaublad\bernard>perl mailstuurde +r.pl Net::SMTP_auth>>> Net::SMTP_auth(0.07) Net::SMTP_auth>>> Net::SMTP(2.29) Net::SMTP_auth>>> Net::Cmd(2.26) Net::SMTP_auth>>> Exporter(5.58) Net::SMTP_auth>>> IO::Socket::INET(1.27) Net::SMTP_auth>>> IO::Socket(1.28) Net::SMTP_auth>>> IO::Handle(1.24) Net::SMTP_auth: Unexpected EOF on command channel at mailstuurder.pl l +ine 8 Can't call method "auth" on an undefined value at mailstuurder.pl line + 9.
And here is the code I use:
#!/usr/bin/perl use warnings; use strict; use Net::SMTP_auth; use Net::SMTP; my $smtp = Net::SMTP_auth->new('smtp.gmail.com', Debug => 1); $smtp->auth('LOGIN', 'b.siebens@gmail.com', '********'); $smtp->mail('watcher@landbouwkring.be'); $smtp->to('b.siebens@gmail.com'); $smtp->data(); $smtp->datasend("To: b.siebens\@gmail.com"); $smtp->datasend("From: watcher\@landbouwkring.be"); $smtp->datasend("\n"); $smtp->datasend("A simple test message.\n"); $smtp->dataend(); $smtp->quit();
Anybody knows how I can fix this error? I've tried all from Mail::Mailer to Mail::Sendmail (and some other things), but this seems to be best suited to solve my problems, so getting this to work would be quite nice.

Replies are listed 'Best First'.
Re^2: Net::SMTP_auth
by Anonymous Monk on Oct 21, 2010 at 06:28 UTC
    Hi Everyone, I need help too. My code use to work with Verizon (changed providers) but it does not work when I use my own domain. The settings work with my website on the same computer using php so I know the domain and password are valid. This is my error message:
    Can't call method "auth" on an undefined value at send_mail.pm line 31.

    Can someone please help?

    Small perl test script below

    #!/usr/bin/perl require "send_mail.pm"; $title = "my title"; $desc = 'my desc'; $link = 'http://www.google.com'; $epoch = 1287629117; $file_name = 'file.txt'; $input[2] = 'kevin@mydomain.net'; &send_mail::send_email ($title, $desc, $link, $epoch, $file_name, \$$i +nput[2]);
    Function below
    package send_mail; sub send_email (){ my ($title, $desc, $link, $epoch, $name, $emails) = @_; use POSIX qw(strftime); my $est = strftime "%a, %B %d, %Y, %X %z", localtime($epoch); my $smtp = Net::SMTP->new('mail.mydomain.net', LocalAddr => 2626, Timeout => 10, Debug => 1 ); $smtp->auth( 'kevin@mydomain.net', 'password'); $smtp->mail('kevin@mydomain.net'); # use the sender's adress here my @em = split (',',$$emails); foreach (@em){ $smtp->to($_); # recipient's address } $smtp->data(); # Start the mail $smtp->datasend("Subject: " . $title); $smtp->datasend("\n" . $desc . "\n" . $link . "\nListing time: " . $ +est ); $smtp->datasend("\n\n bunch of text here " . $name); $smtp->dataend(); # Finish sending the mail $smtp->quit; # Close the SMTP connection }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://506104]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2022-01-26 23:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (70 votes). Check out past polls.

    Notices?