I am trying to send an e-mail out with NET::SMTP. at first i was having difficulties having it connect to the server but thanks to the chatterbox users i got it connecting. i now get this from the debugging info. it looks like it works but i never recieve the e-mail. does anyone have any ideas.
Net::SMTP>>> Net::SMTP(2.29) Net::SMTP>>> Net::Cmd(2.26) Net::SMTP>>> Exporter(5.58) Net::SMTP>>> IO::Socket::INET(1.27) Net::SMTP>>> IO::Socket(1.28) Net::SMTP>>> IO::Handle(1.24) Net::SMTP=GLOB(0x1a093b0)<<< 220 mail.bellsouth.net ESMTP server (Inte +rMail vM.5.01.06.11 201-253-122-130-111-20040605) ready Wed, 4 May 20 +05 18:22:37 -0400 Net::SMTP=GLOB(0x1a093b0)>>> EHLO localhost.localdomain Net::SMTP=GLOB(0x1a093b0)<<< 250-imf17aec.mail.bellsouth.net Net::SMTP=GLOB(0x1a093b0)<<< 250-HELP Net::SMTP=GLOB(0x1a093b0)<<< 250-PIPELINING Net::SMTP=GLOB(0x1a093b0)<<< 250-DSN Net::SMTP=GLOB(0x1a093b0)<<< 250-8BITMIME Net::SMTP=GLOB(0x1a093b0)<<< 250 SIZE 26214400 Net::SMTP=GLOB(0x1a093b0)>>> MAIL FROM:<**************@gmail.com> Net::SMTP=GLOB(0x1a093b0)<<< 250 Sender <**************@gmail.com> Ok Net::SMTP=GLOB(0x1a093b0)>>> RCPT TO:<**************@hotmail.com> Net::SMTP=GLOB(0x1a093b0)<<< 250 Recipient <**************@hotmail.com +> Ok Net::SMTP=GLOB(0x1a093b0)>>> DATA Net::SMTP=GLOB(0x1a093b0)<<< 354 Ok Send data ending with <CRLF>.<CRLF +> Net::SMTP=GLOB(0x1a093b0)>>> . Net::SMTP=GLOB(0x1a093b0)<<< 250 Message received: 20050504222237.KCUR +2434.imf17aec.mail.bellsouth.net@localhost.localdomain Net::SMTP=GLOB(0x1a093b0)>>> QUIT Net::SMTP=GLOB(0x1a093b0)<<< 221 imf17aec.mail.bellsouth.net ESMTP ser +ver closing connection
note: yes the *'s are just me removing any e-mail info here is my actually code
#!perl use strict; use Net::SMTP; open STDERR, ">errlog.log" or die "Couldn't open errlog.log: $!\n"; open CONFIG, "config.ini" or die "Couldn't open config.ini: $!\n"; dbmopen(my %DATA, "mail_database", undef) or die "Cannot open database: $!\n"; chomp(my ($from, $server, $message_path) = <CONFIG>); if($from =~ /^E-MAIL:\s?(\w+(\.)?\w+\@\w+\.\w+)/){ $from = $1; } if($server =~ /^SERVER:\s?(\w+\.\w+.\w+)/){ $server = $1; } if($message_path =~ m<^MESSAGE_PATH:\s?((\.?(/|\\)?\w+)+)>){ $message_path = $1; } open MESSSAGE, "$message_path" or die "Couldn't open '$message_path': $!\n"; chomp(my @message = <MESSAGE>); my ($sec, $min, $hour, $day, $month) = localtime; $month++; my @send_to = &get_emails; foreach(@send_to){ my $smtp; $smtp = Net::SMTP->new($server, Timeout => 60, Debug => 1) or die "Couldn't connect to server '$server': $!.\n" unless $smtp; $smtp->mail($from); $smtp->to($_); $smtp->data(); foreach(@message){ $smtp->datasend($_); } $smtp->dataend(); $smtp->quit; } print "Done.\n"; sub get_emails{ my @to; foreach(keys %DATA){ if($DATA{$_} eq "$month $day"){ push(@to, $_); } } if(defined @to){ return @to; } else{ die "No e-mails found with today's date.\n"; } }

In reply to Having trouble sending an e-mail with NET::SMTP by BlindMonkey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.