I have a PERL script to generate a form email, and it worked flawlessly thousands of times, until my ISP started requiring authentication. I'm stumped now in trying to write the line(s) of code to send out the username and password to authenticate to the ISP's mail server, which is my smart host. The script without authentication is as follows:
send_mail($to, $from, $subject, $comments, $username, $userip, $useremail, $userurl, $daten, $timen);
sub send_mail {
use Net::SMTP;
my $relay = "myISP.net";
my $smtp = Net::SMTP->new($relay)
|| die "Can't open mail connection: $!";
$smtp->mail($fromemail);
$smtp->to($masteremail);
$smtp->data();
$smtp->datasend("To: $masteremail\n");
$smtp->datasend("From: mydomain.com\n");
$smtp->datasend("Subject: New email sent to mydomain.com\n");
$smtp->datasend("\n");
$smtp->datasend("\n");
$smtp->datasend("\n");
$smtp->datasend("A copy of the message can be found below\n");
$smtp->datasend("======================================\n");
$smtp->datasend(" NAME: $username($userip) at $daten($timen)\n");
$smtp->datasend(" EMAIL: $useremail\n");
$smtp->datasend(" \n");
$smtp->datasend(" $comments\n");
$smtp->datasend(" \n");
$smtp->dataend();
$smtp->quit();
}
&guestbook_succ("Your message has been successfully sent.");
}
Can anyone help with the missing code to pass the username and password? I'm using Mailenable for Windows on a Windows 2000 platform. Works great except for this new snag. The error I get is:
"Communications Error: Socket connection to myISP.net failed. Message Delivery Failure (EBFC37A9E37D4A458C909D66A33F4.MAI) Attempt (0): Could not find mail server for domain (). Message has been requeued."
Last night I discovered for inexplicable reasons that if I reboot the server (not merely restart the SMTP service), the message delivers instantly. Obviously I can't live with that as a method. Any help appreciated.
Newposter
"Good judgment comes from experience. Experience comes from bad judgment."
send_mail($to, $from, $subject, $comments, $username, $userip, $useremail, $userurl, $daten, $timen);
sub send_mail {
use Net::SMTP;
my $relay = "myISP.net";
my $smtp = Net::SMTP->new($relay)
|| die "Can't open mail connection: $!";
$smtp->mail($fromemail);
$smtp->to($masteremail);
$smtp->data();
$smtp->datasend("To: $masteremail\n");
$smtp->datasend("From: mydomain.com\n");
$smtp->datasend("Subject: New email sent to mydomain.com\n");
$smtp->datasend("\n");
$smtp->datasend("\n");
$smtp->datasend("\n");
$smtp->datasend("A copy of the message can be found below\n");
$smtp->datasend("======================================\n");
$smtp->datasend(" NAME: $username($userip) at $daten($timen)\n");
$smtp->datasend(" EMAIL: $useremail\n");
$smtp->datasend(" \n");
$smtp->datasend(" $comments\n");
$smtp->datasend(" \n");
$smtp->dataend();
$smtp->quit();
}
&guestbook_succ("Your message has been successfully sent.");
}
Can anyone help with the missing code to pass the username and password? I'm using Mailenable for Windows on a Windows 2000 platform. Works great except for this new snag. The error I get is:
"Communications Error: Socket connection to myISP.net failed. Message Delivery Failure (EBFC37A9E37D4A458C909D66A33F4.MAI) Attempt (0): Could not find mail server for domain (). Message has been requeued."
Last night I discovered for inexplicable reasons that if I reboot the server (not merely restart the SMTP service), the message delivers instantly. Obviously I can't live with that as a method. Any help appreciated.
Newposter
"Good judgment comes from experience. Experience comes from bad judgment."