note 26866 added to function.mail
| From: | support at start4all dot com | Date: | Fri, 15 Nov 2002 10:27:25 +0000 |
| Subject: | note 26866 added to function.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-39527@lists.php.net to get a copy of this message | ||
I wanted bounced mail to get bounced to a different email adress (ex. bounced@start4all.com)...
Therefore I informed this site for more information. And there it is was a solution of Mike:
[quote]
mscappa at tresware dot com
28-Mar-2002 01:43
An easier way to allow the bounce-back capturing of errors, in the sendmail.cf file go down to the
line
0UserErrorsTo=False, just change it to True. This way you do not need to add apache to the trusted
users and have the security risk. Save the sendmail.ct, and then use the header
Errors-To: your@emailaddress.com
Bam!, now you get a copy of the bounce.
-Mike Scappa
[/quote]
But after I did this action my server was not sending any mail anymore. But it only bounced the mail
to the mail address I added to the header. The script I used to test is below:
[code]
<?
/* recipients */
$to = "de Oude School <info@oude-school.nl>" . ", " ; // note the comma
$to .= "Mark in the Dark <auto@oude-school.nl>";
/* subject */
$subject = "Testing from localhost";
/* message */
$message = '
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';
/* To send HTML mail, you can set the Content-type header. */
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
//$headers .= "Errors-To: <bounce@oude-school.nl>\r\n";
/* additional headers */
$headers .= "From: From Naam <from@oude-school.nl>\r\n";
/* and now mail it */
mail($to, $subject, $message, $headers);
?>
[/code]
Does anyone know why it doesn't word? Or does someone has another solution the get the bounced
email into a separated mail box???
Thanx and with regards,
Mark
--
http://www.php.net/manual/en/function.mail.php
http://master.php.net/manage/user-notes.php?action=edit+26866
http://master.php.net/manage/user-notes.php?action=delete+26866
http://master.php.net/manage/user-notes.php?action=reject+26866