NYCPHP Meetup

NYPHP.org

[nycphp-talk] sending email from PHP

corey szopinski corey at domanistudios.com
Thu Jun 3 14:59:46 EDT 2004


This looks like it might be the solution I¹m looking for. Thanks Mike.

-c



On 6/3/04 2:46 PM, "DeWitt, Michael" <mjdewitt at alexcommgrp.com> wrote:

> I have some issues along these lines but made a few changes in the way PHP
> interfaces with sendmail.  Here are the key changes:
> 
> 
> 1. Set the from address in sendmail before you use it and set delivery mode
> to defer.  Make sure your from address is a trusted user of sendmail to
> suppress the warning of identity change.
> 
> $fromaddress='info at yourdomain.com'
>         putenv("PHP_SENDMAILPARAMS= -O DeliveryMode=defer -f
> $fromaddress");
> 
> 2. Build your lists and use the regular ole mail command
> 
>             $datasent=mail($toaddress, $subject,
> $bodytext, "From: ".$fromaddress."\r\n"
>                  ."Bcc:".$addbcc."\r\n"
>                 ."Reply-To: ".$fromaddress."\r\n"
>                 ."Errors-To: <".$fromaddress.">"."\r\n"
>                 ."X-Mailer: PHP/" . phpversion());
> 
> 3.Flush the queue or just wait for sendmail's natural queue flush (depends
> on how you have this setup and how quickly you need to process the queue)
> 
> $processq=exec('/usr/lib/sendmail -q >/dev/null &');
> 
> Making these changes made email broadcasts practical and is 100 x faster
> than the default setup where php waits for sendmail to deliver.
> 
> Hope this helps
> 
> Mike
> 


DOMANI STUDIOS

Corey Szopinski
Technology Director
   
corey at domanistudios.com
70 Washington St. Suite 710
Brooklyn, NY 11201
718.797.4470  x116 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20040603/08888c1a/attachment.html>


More information about the talk mailing list