Lunarpages Web Hosting Forum

Author Topic: SMTP settings for Perl script  (Read 3702 times)

Offline bagpuss03

  • Pong! (the videogame) Master
  • *****
  • Posts: 25
SMTP settings for Perl script
« on: May 27, 2010, 02:41:56 PM »
I have a perl script which currently uses sendmail, but I'd like to change it to SMTP.

I am looking to replace:

$mailprogram = "/usr/sbin/sendmail -t";
$oursalesemail = "email\@domain.com";

with something like:

use Net::SMTP;
$smtp = Net::SMTP->new('mail.mydomain.com'); # connect to my SMTP server
Timeout => 30;
Helo => $ENV{'SERVER_NAME'};
AUTH => PLAIN;
username => "email\@domain.com";
password => "password";
$oursalesemail = "email\@domain.com";

However, I don't think this is quite right. Can you please explain how I would include the correct SMTP settings for perl on LPCP?