Re: php mail() and sendmail/smtp
| From: | Daniel P. Brown | Date: | Thu, 02 Dec 2010 21:22:56 +0000 |
| Subject: | Re: php mail() and sendmail/smtp | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-309821@lists.php.net to get a copy of this message | ||
2010/12/2 Michael Crowl <octopus@serv.net>:
>
> Possible solutions? I'm a little frazzled and a little undereducated here.
Use the under-appreciated fifth paramter in mail() to pass the -f
flag to sendmail, like so:
<?php
$to = 'danbrown@php.net';
$subject = 'This is an emample for a php-general request!';
$body = 'This is the body of the email.';
$headers = "From: daniel.brown@parasane.net\r\n";
$headers .= "X-Mailer: PHP/".phpversion()."\r\n";
$sendmail_flag = '-fdaniel.brown@parasane.net'; // Note the lack of
space between the flag and variable
mail($to,$subject,$body,$headers,$sendmail_flag);
?>
--
</Daniel P. Brown>
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/