Re: mail function problem
- From: petersprc <petersprc@xxxxxxxxx>
- Date: Sat, 30 Jun 2007 03:25:23 -0000
Does this little test give you any errors:
<?
error_reporting(E_ALL);
// Change this:
$to = 'someEmailAddressBlah@xxxxxxxxx';
$file = '/tmp/test.txt';
$fh = fopen($file, 'w') or die('fopen');
fwrite($fh, "Subject: Test\r\nTo: $to\r\nHi.\n");
fclose($fh) or die('fclose');
$sm = ini_get('sendmail_path');
echo "Sending mail using $sm.<br>";
$cmd = "$sm < $file 2>&1";
exec($cmd, $output, $exitCode);
if ($exitCode != 0) {
echo "Command \"$cmd\" failed with exit code $exitCode: " .
join("\n", $output) . "<br>";
} else {
echo "Successfully sent mail.<br>";
}
?>
On Jun 29, 8:12 am, w...@xxxxxxxxxxxxxx wrote:
Hi,
I'm running PHP 5.2.3 on Solaris 10 (AMD64).
My mail function doesn't send any mail, the return value of mail
function is false...
But sendmail_path value is OK in php.ini, and I've tried to send a mail
with sendmail on console with the same user (the apache user), and
everything's ok...
Does anyone have solution ?
Thanks for help.
.
- References:
- mail function problem
- From: web2
- mail function problem
- Prev by Date: Re: Internationalization of webpages with php ... best practices?
- Next by Date: Selecting Rows Based on Row Values Being in Array
- Previous by thread: mail function problem
- Next by thread: Address book - LDAP or MySQL?
- Index(es):
Relevant Pages
|