note 66729 added to ref.mail
| From: | chris at w3style dot co dot uk | Date: | Sat, 27 May 2006 19:10:54 +0000 |
| Subject: | note 66729 added to ref.mail | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-112376@lists.php.net to get a copy of this message | ||
mail() opens a new connection for each email it sends out which causes some significant overhead if
you're sending out many emails in one go.
You can avoid this by using sockets like Antony Male has done and then send as many emails as you
like through the same connection. It should be noted however that some MTA's will reject your
emails after you've sent over a certain threshold on the same connection (about 10 would be
normal) so it's worth disconnecting and reconnecting periodically.
I'm surprised nobody has drawn attention to PHPMailer (http://phpmailer.sourceforge.net) which
makes this sort of stuff really easy. Even better still is Swift Mailer by Chris Corbyn
(http://www.swiftmailer.org) because it includes plugin support and it's tighter.
Another thing that's bitten me before is Magic Quotes! If it's turned on and you're
sending attachments that seem to arrive corrupted it's more than likely because your
attachments are full of backslashes.
Hope the links might be useful to some people :)
----
Server IP: 84.18.202.180
Probable Submitter: 82.11.130.96
----
X-Spam-Status: Yes, hits=5.5 required=5.0 tests=BANG_QUOTE,DATE_MISSING,
FROM_NO_LOWER autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/ref.mail.php
Edit -- http://master.php.net/note/edit/66729
Del: integrated -- http://master.php.net/note/delete/66729/integrated
Del: useless -- http://master.php.net/note/delete/66729/useless
Del: bad code -- http://master.php.net/note/delete/66729/bad+code
Del: spam -- http://master.php.net/note/delete/66729/spam
Del: non-english -- http://master.php.net/note/delete/66729/non-english
Del: in docs -- http://master.php.net/note/delete/66729/in+docs
Del: other reasons-- http://master.php.net/note/delete/66729
Reject -- http://master.php.net/note/reject/66729
Search -- http://master.php.net/manage/user-notes.php