in reply to Sending email in perl

Net::SMTP provides an auth(user, pass) method. Use Mail::Mailer to send your email.

Replies are listed 'Best First'.
Re^2: Sending email in perl
by Eagle_f91 (Acolyte) on Sep 16, 2005 at 00:20 UTC
    I have tryed the Net:SMTP module and I get an error of not being able to call AUTH on an uninitialized value. (The same goes for NET::SMTP_Auth) For Mail::Mailer I can not figure out how to call the auth command. As for Email::Send::SMTP::Auth I have looked at it but I can not figure out how to send header information and message text. I am really new to perl so these online docs cpan gives really do not help me. It seams to me the docs are eather poorly written or geared to you pros.

      Show us the code that gives the uninitialized value error.


      Perl is Huffman encoded by design.
        THis is the code that gives me the error. Even if I change it to use Net::SMTP_auth I will get the same error. Note I have removed my UID and PASS for security and the @ in my email to prevent harvisting
        #!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser); print "Content-type: text/html\n\n"; use Net::SMTP; $smtp = Net::SMTP -> new('mail.ffinfo.com'); $smtp -> auth('UID', 'PASS'); $smtp -> mail('ffxils ffinfo.com'); $smtp -> to('ffxils ffinfo.com'); $smtp -> data(); $smtp -> datasend("To: \"Crystal Reverine Admins\" <ffxils\@ffinfo.com +>\r\n"); $smtp -> datasend("From: \"Crystal Reverine Registration Script\" <ffx +ils\ ffinfo.com>\r\n"); $smtp -> datasend("X-Mailer: Crystal Rebberine Registration Script Net +::SMTP\r\n"); $smtp -> datasend("Subject: New Member Reqestrations\r\n"); $smtp -> datasend("\r\n"); $smtp -> datasend('A new member has registered at the LS website and i +s waiting for approval. Please click on the below link to get a list +of all waiting members'); $smtp -> dataend(); $smtp -> quit();