Re: [Hampshire] Sending mail from PHP

Top Page

Reply to this message
Author: Dominic Cleal
Date:  
To: hampshire
Subject: Re: [Hampshire] Sending mail from PHP
On Tue, 12 Jun 2007 10:12:13 +0100, Daniel Pope wrote:
> Mark Allman/Sparky^, who occassionally pops in here, swears by a
> library called PHPMailer[1], which comprises wrapper classes for
> composing RFC(2)822 and MIME emails and makes it simple to send via
> SMTP.
>
> I'm afraid I've never used it myself so I can't offer any personal
> endorsement, but I have found for myself that it is only ever less
> troublesome to send via SMTP than resolve the issues which can crop
> up when attempting to pipe via sendmail.
>
> There is a disadvantage, but a minor one: you lose the ability to
> insert clever scripts or wrappers in place of the sendmail command.


In addition:
You also lose the ability to queue e-mails, which your machine's MTA
would normally do. This will cause problems when delivering to sites
that have temporary errors (including greylisting).

Your script may suffer from large delays (particularly deliberate SMTP
delays by the remote MTA, or DNS/ident timeouts etc), though this may
or may not be a problem depending on the environment.

One handy advantage is that you'll get any permanent error messages
straight away, instead of an NDR from your MTA if it stores and then
delivers.

--
Dominic Cleal
dominic@???