Fúlvio Figueirôa wrote: > Hi Octavian, > I solved my problem using sendmail with the code below: > > open (MAIL, "|/usr/sbin/sendmail -t "); > print MAIL "From: someaddr...@somedomain\n"; > print MAIL "To: someaddre...@somedomain\n"; > print MAIL "Content-Type: text/plain\n"; > print MAIL "Subject: Very simple email test\n\n"; > print MAIL "Body of the message"; > close (MAIL);
I've had issues with doing things this way in the past. From my experience with the above code, if there is a fault, the message will not be sent, nor will it be queued to be sent later. Depending on the situation, not having the program follow proper SMTP protocol could be a problem if a message is not delivered, and there is no trace of it in any queue. Perhaps someone here can verify that there is a workaround, but I would highly recommend at least handing off the message so that a proper MTA can take care of any network-type issues for you, even if the MTA is on the localhost. My past experience was with receipts... clients would, from time to time, not receive receipts from a Perl-based receipt mailer. I guess, if anything, instead of a file handle directly to MAIL (per above), one could write to file, then mail it, but there are certainly better ways to interact directly to a proper MTA. Steve -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/