Re: [PHP] SMTP vs mail()
Hello, on 01/17/2008 06:57 PM Richard Lynch said the following: > On Thu, January 17, 2008 3:50 am, Richard Heyes wrote: >>> You can easily make a mail queue in php yourself with a daemon that >>> checks the queue and sends waiting mail in batches of say 200 per >>> minute. (provided you have access to the cli on the server) >> Why when there MTAs? > > Your shared host may provide no access to config an MTA, but will shut > you down automatically if you send either more then 75 emails per > minute, or more than 1000 per hour. > > I worked on such a setup, and crafted a PHP DB queue of emails to make > 100% sure their mailing list never got their site shut down. > > I am confident other examples abound. You are right. After all that is an "MTA" too. It is an awkward solution but tt least you will be able work around your ISP constraints. Some time ago an user published a class that does precisely that: http://www.phpclasses.org/newsletter In the past, I used also an unsual solution to send newsletters to the PHPClasses site users. Instead of a database, I used to send e-mail messages that contained newsletter contents and subscriber addresses. Then I used my desktop machine to pop the messages and distribute the newsletters. When it exceeded my ISP limits, I used servers borrowed from kind users, until I finally used a VPS. The distribution system via e-mail still exists and works as a charm, although for now it is not needed to work distributedly. In this blog post you can read all the details. http://www.phpclasses.org/blog/post/65-8-defensive-programming-best-practices-to-prevent-breaking-your-sites.html -- Regards, Manuel Lemos PHP professionals looking for PHP jobs http://www.phpclasses.org/professionals/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On Thu, January 17, 2008 3:50 am, Richard Heyes wrote: >> You can easily make a mail queue in php yourself with a daemon that >> checks the queue and sends waiting mail in batches of say 200 per >> minute. (provided you have access to the cli on the server) > > Why when there MTAs? Your shared host may provide no access to config an MTA, but will shut you down automatically if you send either more then 75 emails per minute, or more than 1000 per hour. I worked on such a setup, and crafted a PHP DB queue of emails to make 100% sure their mailing list never got their site shut down. I am confident other examples abound. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
You can easily make a mail queue in php yourself with a daemon that checks the queue and sends waiting mail in batches of say 200 per minute. (provided you have access to the cli on the server) Why when there MTAs? -- Richard Heyes http://www.websupportsolutions.co.uk Mailing list management service allowing you to reach your Customers and increase your sales. ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
You can easily make a mail queue in php yourself with a daemon that checks the queue and sends waiting mail in batches of say 200 per minute. (provided you have access to the cli on the server) Black http://rssphp.net a85020316bb687648d6f73c4eb3bec93 :msg::id Chris wrote: Manuel Lemos wrote: Hello, on 01/15/2008 07:16 AM Per Jessen said the following: If there's any way to re-configure the MTA to queue the messages for later sending, that would save you a lot of overhead on the PHP end... The MTA will always queue the messages - well, that is certainly the case for postfix. qmail too. Sendmail can be configured to just queue the messages too but that is not its default configuration. This is all getting way OT for php. All except exim will queue the message AND have a process that looks at the queue at the same time. exim has an option called 'queue_only' which then tells it to just store the message and there is no process trying to actually send the emails until it hits another option which tells it when to run the queue. If you run 'mailq' (or qmail-qstat) while you are sending lots of emails, the numbers and emails will change as emails are incoming and outgoing at the same time. You won't see emails sitting at the top of the send queue for very long because another process is picking it up and sending it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Manuel Lemos wrote: Hello, on 01/15/2008 07:16 AM Per Jessen said the following: If there's any way to re-configure the MTA to queue the messages for later sending, that would save you a lot of overhead on the PHP end... The MTA will always queue the messages - well, that is certainly the case for postfix. qmail too. Sendmail can be configured to just queue the messages too but that is not its default configuration. This is all getting way OT for php. All except exim will queue the message AND have a process that looks at the queue at the same time. exim has an option called 'queue_only' which then tells it to just store the message and there is no process trying to actually send the emails until it hits another option which tells it when to run the queue. If you run 'mailq' (or qmail-qstat) while you are sending lots of emails, the numbers and emails will change as emails are incoming and outgoing at the same time. You won't see emails sitting at the top of the send queue for very long because another process is picking it up and sending it. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Hello, on 01/15/2008 07:16 AM Per Jessen said the following: >> If there's any way to re-configure the MTA to queue the messages for >> later sending, that would save you a lot of overhead on the PHP end... > > The MTA will always queue the messages - well, that is certainly the > case for postfix. qmail too. Sendmail can be configured to just queue the messages too but that is not its default configuration. -- Regards, Manuel Lemos PHP professionals looking for PHP jobs http://www.phpclasses.org/professionals/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
i can vouch. postfix rocks. i send it non-stop 30,000+ emails at a time (a loop from a database that does a popen("/usr/sbin/sendmail") on the local machine (also postfix) which then relays it to my actual public smtp server (running postfix) - and it just throws it all into the queue and chews on that for a while... On 1/15/08, Per Jessen <[EMAIL PROTECTED]> wrote: > Richard Lynch wrote: > > > If there's any way to re-configure the MTA to queue the messages for > > later sending, that would save you a lot of overhead on the PHP end... > > The MTA will always queue the messages - well, that is certainly the > case for postfix. > > > > /Per Jessen, Zürich > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] SMTP vs mail()
Richard Lynch wrote: > If there's any way to re-configure the MTA to queue the messages for > later sending, that would save you a lot of overhead on the PHP end... The MTA will always queue the messages - well, that is certainly the case for postfix. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On Sat, January 12, 2008 4:28 am, Richard Heyes wrote: Assuming you're talking delivery to a local MTA (which will subsequently do the remote delivery), is speed really important? >>> For the amount of email I'm looking at (1000s, growing), yes. >>> >> >> Hmm, that's not quite what I was thinking of. The amount of emails >> to >> be delivered does not in my opinion affect how fast it needs to >> happen. >> Your local MTA will take a while to deliver those emails anyway, so >> the >> time from script to user is mostly dependent on that, which means >> you're left with reducing the time from script to MTA. If you need >> to >> finish the script fast (in order for some user-intercation to >> continue >> perhaps), I would would just detach the script and carry on. > > Sorry, yes the time of delivery is not so important as the time to > pump > the messages to the MTA. As long as the MTA has them and they get > delivered in a reasonable time frame I'm happy. The application is all > about mail delivery and the script has to return immediately, so I'll > be > launching a separate process to insert the addresses into a minimal > "mail_queue" table in my db, and then a 5 minutely cron script which > will pass them to the MTA. If there's any way to re-configure the MTA to queue the messages for later sending, that would save you a lot of overhead on the PHP end... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Per Jessen wrote: Richard Heyes wrote: Bearing in mind I haven't yet done any benchmarks, which do you think is faster - SMTP with multiple RCPT commands or the PHP mail() function (with it launching a separate sendmail process for each mail() function call)? I've done some rough benchmarking - 1. Using mail(), same email sent to 1000 users. Script finished in 200ms (1000 emails delivered to local MTA). Delivery to target MTA over 100Mbit LAN took about 6s. 2. Using mail(), same email sent to 1 users (in blocks of 1000 recipients). Script finished in 2.6s (1 emails delivered to local MTA). Delivery to target MTA over 100Mbit LAN took about 4m20s. 3. Using mail(), but individual emails sent to 1000 users. Script finished in 59s (1000 emails delivered to local MTA). Delivery to target MTA over 100Mbit LAN took about 60s. 4. I didn't bother with 1 individual emails. 5. Repeat case 3, but actual calls of mail() forked using pcntl_fork. 50ms. I didn't bother timing the delivery to target MTA, but I estimate the same as in case 3. 6. Same email to 1000 users sent by piping to "sendmail -oi -t" 60ms. I didn't bother timing the delivery to target MTA. 7. Same email to 1 users sent by piping to "sendmail -oi -t" 230ms. I didn't bother timing the delivery to target MTA. 8. Same email to 10 users sent by piping to "sendmail -oi -t" 2.4s. I didn't bother timing the delivery to target MTA. Hardware was a plain P4, 2.4GHz running openSUSE. You might be able to beat cases 6-7-8 by doing direct SMTP, but I doubt if it'll be worth your effort. /Per Jessen, Zürich Per's results were pretty much as i'd expected :)
Re: [PHP] SMTP vs mail()
Note - this was one call to mail(): mail(",, ..",subject,text); Granted, but as long as the email stays the same size when you compare mail() and something like SMTP, I wouldn't imagine the relative speeds varying significantly. Or maybe they would, I'll compare and see. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Richard Heyes wrote: >> 1. Using mail(), same email sent to 1000 users. >> >> Script finished in 200ms (1000 emails delivered to local MTA). >> Delivery to target MTA over 100Mbit LAN took about 6s. > > That settles it then. The mail() command will be more than fast enough > for my needs. > > Thanks. Note - this was one call to mail(): mail(",, ..",subject,text); /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
1. Using mail(), same email sent to 1000 users. Script finished in 200ms (1000 emails delivered to local MTA). Delivery to target MTA over 100Mbit LAN took about 6s. That settles it then. The mail() command will be more than fast enough for my needs. Thanks. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Richard Heyes wrote: > Bearing in mind I haven't yet done any benchmarks, which do you think > is faster - SMTP with multiple RCPT commands or the PHP mail() > function (with it launching a separate sendmail process for each > mail() function call)? > I've done some rough benchmarking - 1. Using mail(), same email sent to 1000 users. Script finished in 200ms (1000 emails delivered to local MTA). Delivery to target MTA over 100Mbit LAN took about 6s. 2. Using mail(), same email sent to 1 users (in blocks of 1000 recipients). Script finished in 2.6s (1 emails delivered to local MTA). Delivery to target MTA over 100Mbit LAN took about 4m20s. 3. Using mail(), but individual emails sent to 1000 users. Script finished in 59s (1000 emails delivered to local MTA). Delivery to target MTA over 100Mbit LAN took about 60s. 4. I didn't bother with 1 individual emails. 5. Repeat case 3, but actual calls of mail() forked using pcntl_fork. 50ms. I didn't bother timing the delivery to target MTA, but I estimate the same as in case 3. 6. Same email to 1000 users sent by piping to "sendmail -oi -t" 60ms. I didn't bother timing the delivery to target MTA. 7. Same email to 1 users sent by piping to "sendmail -oi -t" 230ms. I didn't bother timing the delivery to target MTA. 8. Same email to 10 users sent by piping to "sendmail -oi -t" 2.4s. I didn't bother timing the delivery to target MTA. Hardware was a plain P4, 2.4GHz running openSUSE. You might be able to beat cases 6-7-8 by doing direct SMTP, but I doubt if it'll be worth your effort. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Assuming you're talking delivery to a local MTA (which will subsequently do the remote delivery), is speed really important? For the amount of email I'm looking at (1000s, growing), yes. Hmm, that's not quite what I was thinking of. The amount of emails to be delivered does not in my opinion affect how fast it needs to happen. Your local MTA will take a while to deliver those emails anyway, so the time from script to user is mostly dependent on that, which means you're left with reducing the time from script to MTA. If you need to finish the script fast (in order for some user-intercation to continue perhaps), I would would just detach the script and carry on. Sorry, yes the time of delivery is not so important as the time to pump the messages to the MTA. As long as the MTA has them and they get delivered in a reasonable time frame I'm happy. The application is all about mail delivery and the script has to return immediately, so I'll be launching a separate process to insert the addresses into a minimal "mail_queue" table in my db, and then a 5 minutely cron script which will pass them to the MTA. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Richard Heyes wrote: >> Assuming you're talking delivery to a local MTA (which will >> subsequently do the remote delivery), is speed really important? > > For the amount of email I'm looking at (1000s, growing), yes. > Hmm, that's not quite what I was thinking of. The amount of emails to be delivered does not in my opinion affect how fast it needs to happen. Your local MTA will take a while to deliver those emails anyway, so the time from script to user is mostly dependent on that, which means you're left with reducing the time from script to MTA. If you need to finish the script fast (in order for some user-intercation to continue perhaps), I would would just detach the script and carry on. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Also don't forget the part where you shouldn't disconnect and reconnect between mails sent. indeed but I have experienced situations where the SMTP server refuses more than X number of messages on any one connection ... which meant having to get the script to disconnect/reconnect every 200 (iirc) odd emails sent. Yep - exim by default has a setting of 100 emails per smtp connection. Try to send more than that and you'll get errors. -- Postgresql & php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On Fri, January 11, 2008 12:22 pm, Jochem Maas wrote: > Eric Butera schreef: >> On Jan 11, 2008 11:33 AM, Stut <[EMAIL PROTECTED]> wrote: >>> No brainer, SMTP will almost certainly be faster. My mailing list >>> system >>> (written in PHP obviously) can dump 600k customised emails to the >>> local >>> SMTP server in a couple of hours. Doing the same with the mail >>> command >>> took over 24 hours. How much slower will depend a lot on how you >>> have >>> configured sendmail, but it's never going to be faster than a >>> socket >>> connection to the local SMTP server. >> >> Also don't forget the part where you shouldn't disconnect and >> reconnect between mails sent. > > indeed but I have experienced situations where the SMTP server refuses > more than X number of messages on any one connection ... which meant > having to get the script to disconnect/reconnect every 200 (iirc) odd > emails sent. SMTP software can be configured that way, or not. But it SHOULD be sending proper response codes when it decides to quit on you, and your code *SHOULD* be ready to deal sensibly with those codes, and any others defined in the SMTP spec. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On Fri, January 11, 2008 10:29 am, Richard Heyes wrote: > Bearing in mind I haven't yet done any benchmarks, which do you think > is > faster - SMTP with multiple RCPT commands or the PHP mail() function > (with it launching a separate sendmail process for each mail() > function > call)? If mail() is faster, prepare for the second coming... :-) mail() fires up the send mail binary. For each call. SMTP opens up a socket connection and then you just keep spewing data at it and getting "OK" back (hopefully). You'd have to have a dog-slow SMTP box and a very souped-up sendmail box to get them on the same footing, almost for sure. -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On 1/11/08, Richard Heyes <[EMAIL PROTECTED]> wrote: > > Assuming you're talking delivery to a local MTA (which will subsequently > > do the remote delivery), is speed really important? > > For the amount of email I'm looking at (1000s, growing), yes. one word: phpmailer (http://phpmailer.codeworxtech.com/). seems like the best option. supports everything under the sun. even phplist (which itself seems awesome) uses it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Hello, on 01/11/2008 04:22 PM Jochem Maas said the following: > Eric Butera schreef: >> On Jan 11, 2008 11:33 AM, Stut <[EMAIL PROTECTED]> wrote: >>> No brainer, SMTP will almost certainly be faster. My mailing list system >>> (written in PHP obviously) can dump 600k customised emails to the local >>> SMTP server in a couple of hours. Doing the same with the mail command >>> took over 24 hours. How much slower will depend a lot on how you have >>> configured sendmail, but it's never going to be faster than a socket >>> connection to the local SMTP server. >> >> Also don't forget the part where you shouldn't disconnect and >> reconnect between mails sent. > > indeed but I have experienced situations where the SMTP server refuses > more than X number of messages on any one connection ... which meant > having to get the script to disconnect/reconnect every 200 (iirc) odd > emails sent. That is one more reason to not use SMTP connections for queueing many messages. If you use sendmail or equivalent and the MTA is properly configured, there will be no SMTP disconnect and reconnects to deal with. Using SMTP is simply a bad idea unless your MTA is in a separate machine. Personally I use qmail. It never establishes SMTP connections when you are queueing messages. When I want to deliver messages to many recipients I call the qmail-inject program directly, instead of Qmail sendmail wrapper that is used by the mail function by default. Actually I use the MIME message package that comes with drivers specialize in qmail, sendmail, SMTP and mail. Each driver carries its bag of tricks to optimize deliveries among other options to speedup bulk-mailing in general. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos PHP professionals looking for PHP jobs http://www.phpclasses.org/professionals/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Assuming you're talking delivery to a local MTA (which will subsequently do the remote delivery), is speed really important? For the amount of email I'm looking at (1000s, growing), yes. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Hello, on 01/11/2008 02:33 PM Stut said the following: > Richard Heyes wrote: >> Bearing in mind I haven't yet done any benchmarks, which do you think >> is faster - SMTP with multiple RCPT commands or the PHP mail() >> function (with it launching a separate sendmail process for each >> mail() function call)? > > No brainer, SMTP will almost certainly be faster. My mailing list system > (written in PHP obviously) can dump 600k customised emails to the local > SMTP server in a couple of hours. Doing the same with the mail command > took over 24 hours. How much slower will depend a lot on how you have > configured sendmail, but it's never going to be faster than a socket > connection to the local SMTP server. That is not true. SMTP connections are much slower than calling the sendmail program because calling sendmail uses pipes to communicate and SMTP requires an TCP connection, even if it is to the same machine. Your problem is that you have sendmail in the default configuration, which makes it attempt to deliver the messages when you call it. That is why it was taking too long to send all your messages. You need to configure it to queue the messages locally, instead of attempting to deliver right away. One solution is to use a better MTA like qmail or postfix. If you are stuck with sendmail and you cannot change its default configuration, there are some options to configure it per delivery. Take a look at this message composing and sending package class. It provides some options to optimize the message delivery back end to speed up message queueing. The sendmail backend takes great advantage of these options. Take a look in particular at the script test_personalized_bulk_mail.php . http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos PHP professionals looking for PHP jobs http://www.phpclasses.org/professionals/ PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Richard Heyes wrote: > Bearing in mind I haven't yet done any benchmarks, which do you think > is faster - SMTP with multiple RCPT commands or the PHP mail() > function (with it launching a separate sendmail process for each > mail() function call)? Assuming you're talking delivery to a local MTA (which will subsequently do the remote delivery), is speed really important? /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On Jan 11, 2008 1:26 PM, Eric Butera <[EMAIL PROTECTED]> wrote: > Weird! I've never heard of that but I really don't doubt it. Working > with e-mail is the least favorite part of my work. he said, via email. -- Daniel P. Brown Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since Nineteen-Seventy-[mumble]. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
There is no such thing. :) Perhaps not then... :-) -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On Jan 11, 2008 1:33 PM, Richard Heyes <[EMAIL PROTECTED]> wrote: > > I used to use htmlMimeMail, but now I use Zend_Mail as it has a better > > API and is also faster in regards to the quoted printable encoding. > > IIRC htmlMimeMail use the PHP built in function to do quoted printable > encoding. > > > -- > Richard Heyes > http://www.websupportsolutions.co.uk > > Knowledge Base and HelpDesk software > that can cut the cost of online support > > ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** > There is no such thing. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
I used to use htmlMimeMail, but now I use Zend_Mail as it has a better API and is also faster in regards to the quoted printable encoding. IIRC htmlMimeMail use the PHP built in function to do quoted printable encoding. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On Jan 11, 2008 1:22 PM, Jochem Maas <[EMAIL PROTECTED]> wrote: > Eric Butera schreef: > > On Jan 11, 2008 11:33 AM, Stut <[EMAIL PROTECTED]> wrote: > >> No brainer, SMTP will almost certainly be faster. My mailing list system > >> (written in PHP obviously) can dump 600k customised emails to the local > >> SMTP server in a couple of hours. Doing the same with the mail command > >> took over 24 hours. How much slower will depend a lot on how you have > >> configured sendmail, but it's never going to be faster than a socket > >> connection to the local SMTP server. > > > > Also don't forget the part where you shouldn't disconnect and > > reconnect between mails sent. > > indeed but I have experienced situations where the SMTP server refuses > more than X number of messages on any one connection ... which meant > having to get the script to disconnect/reconnect every 200 (iirc) odd > emails sent. > > > > > > I used to use htmlMimeMail, but now I use Zend_Mail as it has a better > > API and is also faster in regards to the quoted printable encoding. > > > > Weird! I've never heard of that but I really don't doubt it. Working with e-mail is the least favorite part of my work. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Eric Butera schreef: On Jan 11, 2008 11:33 AM, Stut <[EMAIL PROTECTED]> wrote: No brainer, SMTP will almost certainly be faster. My mailing list system (written in PHP obviously) can dump 600k customised emails to the local SMTP server in a couple of hours. Doing the same with the mail command took over 24 hours. How much slower will depend a lot on how you have configured sendmail, but it's never going to be faster than a socket connection to the local SMTP server. Also don't forget the part where you shouldn't disconnect and reconnect between mails sent. indeed but I have experienced situations where the SMTP server refuses more than X number of messages on any one connection ... which meant having to get the script to disconnect/reconnect every 200 (iirc) odd emails sent. I used to use htmlMimeMail, but now I use Zend_Mail as it has a better API and is also faster in regards to the quoted printable encoding. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On Jan 11, 2008 11:33 AM, Stut <[EMAIL PROTECTED]> wrote: > No brainer, SMTP will almost certainly be faster. My mailing list system > (written in PHP obviously) can dump 600k customised emails to the local > SMTP server in a couple of hours. Doing the same with the mail command > took over 24 hours. How much slower will depend a lot on how you have > configured sendmail, but it's never going to be faster than a socket > connection to the local SMTP server. Also don't forget the part where you shouldn't disconnect and reconnect between mails sent. I used to use htmlMimeMail, but now I use Zend_Mail as it has a better API and is also faster in regards to the quoted printable encoding. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
On Jan 11, 2008 11:36 AM, Richard Heyes <[EMAIL PROTECTED]> wrote: > >> Bearing in mind I haven't yet done any benchmarks, which do you think > >> is faster - SMTP with multiple RCPT commands or the PHP mail() > >> function (with it launching a separate sendmail process for each > >> mail() function call)? > > > > No brainer, SMTP will almost certainly be faster. My mailing list system > > (written in PHP obviously) can dump 600k customised emails to the local > > SMTP server in a couple of hours. Doing the same with the mail command > > took over 24 hours. How much slower will depend a lot on how you have > > configured sendmail, but it's never going to be faster than a socket > > connection to the local SMTP server. > > Thanks. Obviously, it will also make a huge difference between a local SMTP and remote SMTP. -- Daniel P. Brown Senior Unix Geek and #1 Rated "Year's Coolest Guy" By Self Since Nineteen-Seventy-[mumble]. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Bearing in mind I haven't yet done any benchmarks, which do you think is faster - SMTP with multiple RCPT commands or the PHP mail() function (with it launching a separate sendmail process for each mail() function call)? No brainer, SMTP will almost certainly be faster. My mailing list system (written in PHP obviously) can dump 600k customised emails to the local SMTP server in a couple of hours. Doing the same with the mail command took over 24 hours. How much slower will depend a lot on how you have configured sendmail, but it's never going to be faster than a socket connection to the local SMTP server. Thanks. -- Richard Heyes http://www.websupportsolutions.co.uk Knowledge Base and HelpDesk software that can cut the cost of online support ** NOW OFFERING FREE ACCOUNTS TO CHARITIES AND NON-PROFITS ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP vs mail()
Richard Heyes wrote: Bearing in mind I haven't yet done any benchmarks, which do you think is faster - SMTP with multiple RCPT commands or the PHP mail() function (with it launching a separate sendmail process for each mail() function call)? No brainer, SMTP will almost certainly be faster. My mailing list system (written in PHP obviously) can dump 600k customised emails to the local SMTP server in a couple of hours. Doing the same with the mail command took over 24 hours. How much slower will depend a lot on how you have configured sendmail, but it's never going to be faster than a socket connection to the local SMTP server. -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php