[TYPO3-dev] Sending emails and check if the mail was accepted

Dimitri Tarassenko mitka at mitka.us
Wed Mar 8 16:23:13 CET 2006


Markus,

On 3/8/06, Markus Friedrich <markus.friedrich at media-lights.de> wrote:
> I'm writing an extension and I need to send emails. I intended to use "t3lib_htmlmail" to do this, but I can't see a possibility to check if the mail was successfully accepted for delivery.
>
> Is there a typo3 function for mailing that allows a check?

The only way to somewhat reliably get this information is to process
the bounces / use img trackers in the email body, and here is why -

1. Many big email houses like Yahoo or HotMail for example, accept
_everything_, even if you misspell the user name of a user you are
sending the email to.

2. "Defer" response from remote server does not mean your message
failed to be delivered, chances are it will be placed in your
sendmail's queue and will be sent during the next queue run (1 hour by
default).

3. Your php may be set to place all outgoing email into local sendmail
queue, versus immediately delivering it to the target server. In this
case, mail() function will always report a success if an email address
is correctly formatted, even if the actual delivery during the queue
run fails later on.

Because a lot of factors can make the delivery information you get
from mail() calls unreliable, I would not base ANY application logic
on it. That's why (I assume) t3lib_htmlmail->sendTheMail() doesn't
even bother with return value of mail(), and you should not, either ;)

--
Dimitri Tarassenko


More information about the TYPO3-dev mailing list