phpemailzend-frameworkverification

How to verify a mail has been sent when using Zend_Mail?


I am using the Zend framework to send mail. Once the config is done and the code written it all boils down to one call:

$Mail->send($Transport)

How can i check that this mail has been sent correctly? I read somewhere that Zend Mail throws an exception but other people have said this is sometimes not the case.

What's the bulletproof programmatic way to ensure mail has been sent properly when using Zend_Mail?

EDIT: When i mean sent, i mean sent to the SMTP server.


Solution

  • Generally Zend_Mail will throw an exception if there is something wrong going on on the send-process - but this strongly depends on the Zend_Mail_Transport_* being used.

    You have two options here: