email problems . . .
| From: | Cameron Brunner | Date: | Wed, 27 Sep 2000 05:42:38 +0000 |
| Subject: | email problems . . . | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-17659@lists.php.net to get a copy of this message | ||
could someone please tell me why the following function only sends
emails correctly to the localhost, they are not accepted on any other
server . . .
all the echo's in there are just so as i can keep track of what hapening
atm . . .
the error in the logs is this . . .
Sep 27 15:32:10 server sendmail[11215]: e8R5W7a11212:
to=psx@dynomyte.net, ctladdr=nobody (65534/65534), delay=00:00:03,
xdelay=00:00:03, mailer=esmtp, pri=30165, relay=mail.dynomyte.net.
[64.7.5.213], dsn=5.6.0, stat=Data format error
Sep 27 15:32:10 server sendmail[11215]: e8R5W7a11212: e8R5WAZ11215: DSN:
Data format error
function send_mail($to, $from, $subject, $body)
{
global $path_to_sendmail;
$fp = popen("$path_to_sendmail -t", "w");
echo "to $to\nfrom $from\n subject $subject\n body $body";
$num = fputs($fp, "To: $to\n");
$num += fputs($fp, "From: $from\n");
$num += fputs($fp, "Subject: $subject\n");
$num += fputs($fp, "MIME-Version: 1.0\n");
$num += fputs($fp, "Content-Type: text/html; charset=\"iso-8859-1\"\n");
$num += fputs($fp, "$body");
$blah = "To: $to\n";
$blah .= "From: $from\n";
$blah .= "Subject: $subject\n";
$blah .= "MIME-Version: 1.0\n";
$blah .= "Content-Type: text/html; charset=\"iso-8859-1\"\n\n\n";
$blah .= "$body";
echo "\n\n\n$blah\n\n\n";
pclose($fp); if ($num>0) { return 1; } else { return 0; }
}
Cameron Brunner
Director of Operations
dynomyte.net