Web Hosting Talk







View Full Version : sendmail problem


mikenn
07-23-2003, 09:52 AM
I am tryign to send mail using send mail. Here is my perl code. It is not working. Is it wroign with coding or with server config. Any inout would be appreciated.


#!/usr/bin/perl
print "Content-type:text/plain\n\n";
$mailprog = "/usr/sbin/sendmail";
open (MAIL, "|$mailprog -t") or die ("Can't open $mailprog\n");
print MAIL "To: userid@domain.com\nFrom:
userid@domain.com\nSubject: testing\n
Content-type:text/plain\n\n";
close (MAIL);
print "sent";

thanks

chrisranjana
07-24-2003, 06:04 AM
assuming sendmail is in fact present in your server !

check using the "whereis" or "find" command whether "/usr/sbin/sendmail" is the path to sendmail on your server.

chirpy
07-24-2003, 12:14 PM
Nope,

The problem is most likely that you need to backslash your @'s,
i.e.:
userid\@domain.com