|
Posted by Michael Fesser on 09/18/07 14:43
..oO(Sanders Kaufman)
>I'm very curious to know why so many folks seem to be using this little
>script - PHPMailer.
>
>I mean - the PHP mail() function is *amazingly* simple to use
Only for the most basic plain text emails. Anything more sophisticated
becomes really ugly if you have to do it by hand. Additionally such
classes can automatically perform some tests and prepare/sanitize/encode
the data you want to send.
>What's the attraction?
The attraction is abstraction.
I also use this class, but with my own wrapper around it. There are some
little glitches in it that I don't like, for example some method names
('isHtml' to enable HTML mode doesn't make sense, it should be 'setHtml'
or something like that, while 'isHtml' should just check the mode and
return a boolean). I also don't like having to "reset" the mailer or to
create another instance if I want to send another email. So instead of
this (pseudo-code, no actual method names):
$mailer->createMail();
$mailer->setText(...);
$mailer->addAddress(...);
$mailer->send();
$mailer->reset();
my own wrapper works more like this:
$mail = $mailer->createMail();
$mail->setText(...);
$mail->addAddress(...);
$mail->send();
Micha
Navigation:
[Reply to this message]
|