PDA

View Full Version : emailing in perl



uhillnet
06-24-2010, 02:13 PM
I have used this mailing format successfully on other servers, but not here.

open(ML,"|sendmail -f user@domain.com -t") || die "Can't send mail";
print ML "To: receiver@domain.com\n";
...
close ML;

This doesn't work on this server.
I get a "Can't send mail" error in the logs.

What is the right way to do this in perl on this machine?

Treeluvin
06-26-2010, 12:30 AM
That should work without a problem.
Have you tried actually printing out the exact error in the $! variable?


open(ML,"|sendmail -f user@domain.com -t") || die "Can't send mail: $!\n";