[nycphp-talk] sending email from PHP
David Yun
dyun at blue-iceberg.com
Thu Jun 3 14:29:16 EDT 2004
Corey,
It sounds like you could have a problem with your sendmail configuration -
have you experienced this problem in the past? The php mail() function is
usually pretty snappy, at least for sending out smaller volumes such as 2
emails.
Also, have you tried using the phpmailer class?
http://phpmailer.sourceforge.net/
David Yun
Production Manager
Blue Iceberg LLC
Interactive Strategy | Website Development | Business Solutions
http://www.blue-iceberg.com
Tel: 212.413.9226 Ext.9238 Fax: 212.413.9201
> I¹m trying to build a tool to send dynamic emails (think order summary) from
> PHP. I¹m running into very long delays waiting for sendmail to return a
> result.
>
> For example, a person submits an order, the function that handles the
> transaction does a couple of things:
>
> 1. Sends an order confirmation to the store
> 2. Sends an order confirmation to the customer
>
> The whole process can take over 1 minute, which times out the browser. I¹ve
> tracked it down the delay to sendmail verifying the remote email address.
> Since sendmail talks to the remote mail server in real-time, any network lag,
> or DNS lag, causes the order process to hang. In my case, it does it twice.
>
> I¹ve looked at Pear Mail_Queue, and that looks interesting, but a bit
> overkill. I¹ve also looked at going around the mail() function and opening an
> SMTP socket directly to sendmail (same delays... in fact when I open a session
> via command line, I can see the exact step in the SMTP conversion where the
> lag happens)
>
> Here¹s what I¹d like to do (and this would be helpful for anyone sending out a
> modest volume of email)...
>
> 1. send the mail to sendmail
> 2. sendmail puts it into a queue
> 3. sendmail periodically checks this queue and sends the email.
>
> Essentially, I¹d like to fork the slow lookup stuff to the background,
> returning control the browser as soon as possible. This has the added benefit
> of scaling to very large emails/hour since the browser never has to wait for
> sendmail (or an external server) before a visitor can move on.
>
> I¹m pretty sure that this is intrinsic to the way sendmail works, but most of
> the documentation talks about the queue holding mail that¹s not deliverable.
> What I¹d like to do is put to put a delay on the email before it¹s processed
> by sendmail.
>
> Any ideas?
>
> -corey
>
>
>
>
> DOMANI STUDIOS
>
> Corey Szopinski
> Technology Director
>
> corey at domanistudios.com
> 70 Washington St. Suite 710
> Brooklyn, NY 11201
> 718.797.4470 x116
>
>
>
> _______________________________________________
> talk mailing list
> talk at lists.nyphp.org
> http://lists.nyphp.org/mailman/listinfo/talk
>
More information about the talk
mailing list