Command disabled: export_raw

Setting the Bounce detect, or Return-path address

When using SMTP, you don’t always know if the message is going to reach the recipient. If something goes wrong and you’re really lucky you’ll know about it at SMTP time if the server reports an error; if you’re not so lucky, but not completely in the dark, you’ll receive an email from a different server saying that something went wrong; and if you’re completely unlucky, you’ll just be left wondering why you never got a response from the recipient.

In order to be sent an email in the event of a failure after the initial SMTP conversation you need to provide an address for this to go to. By default, Swift will use the address of the sender which is passed to send(). However, many people like to set up special mailboxes which do nothing more than collect such failure messages. In that case, because you’d rather not have the message appear with a From: header showing the bounce-detect address, SMTP uses another address which is issued as a command.

All you need to do to get Swift to honour this wish, is specify the address by calling setReturnPath() in the message object:

$message->setReturnPath("bounces@company.tld");
 
//or
 
$message->setReturnPath(new Swift_Address("bounces@company.tld"));

NOTE: If you pass a Swift_Address object, only the email address will actually be used.

 
v3/sending/bounce_address.txt · Last modified: 2007/03/22 16:20 by d11wtq
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki