Mass emails

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Mass emails

Post by alex.barylski »

I've looked over the docs (you've done a great job BTW - very clear) and have read the forums here but still have a few unanswered questions.

In looking to implement bounce detection. It looks like you suggest two methods:

1) Checking SMTP return code
2) Parsing a email sent back to bounce@whatever.com

The latter sounds like a PITA because each different mail server formats the message differently? Can you confirm this? Is this each MTA (Exim, Postfix, sendmail, etc)?

So really, there is a fixed number of replies you can receive? Is this something which could be built into Swift, via plugins or similar? Or would it be considered something entirely separate?

By parsing the email, do you really get more details about the bounce? What If I was just interested in a bounce period could I not just extract the standardized email headers (from, etc)?

My next question: In sending mass customized emails (unique body, subject, etc) how would you suggest utilizing Swift to it's most efficient capability? Do I keep track of the mailing queue using PHP and a cron? I was hoping to just send all the messages to SMTP server and let the MTA worry about messages after that, but it sounds/looks like I will have to manually manage the list keeping track of which email addresses have been sent an email, etc???

Cheers :)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Mass emails

Post by Chris Corbyn »

Hockey wrote:I've looked over the docs (you've done a great job BTW - very clear)
Thanks :)
Hockey wrote:In looking to implement bounce detection. It looks like you suggest two methods:

1) Checking SMTP return code
2) Parsing a email sent back to bounce@whatever.com
1) That's not really bounce detection if it fails at SMTP-time. A bounce is a message the looks to have been accepted but is later failed.
2) Correct.
Hockey wrote:The latter sounds like a PITA because each different mail server formats the message differently? Can you confirm this? Is this each MTA (Exim, Postfix, sendmail, etc)?
Correct. But it's not even as simple as a postfix message looking one way and a exim one another way. It's configurable so you really don't know what to expect. It's probably best to simply scan any messages coming back on that address for email addresses.
Hockey wrote:So really, there is a fixed number of replies you can receive? Is this something which could be built into Swift, via plugins or similar? Or would it be considered something entirely separate?
There's no fixed number of bounce formats. It could be anything at all. It's also completely out of the scope of what Swift is for. If I was to write such a tool it would be a seperate project since reading emails is in no way shape or form the same as sending them.
Hockey wrote:By parsing the email, do you really get more details about the bounce? What If I was just interested in a bounce period could I not just extract the standardized email headers (from, etc)?
There's no standard for it. No RFC, nothing. Usually the messages tell you *why* it failed though yes. You'll often get a message every 24 hours for up to 5 days too.
Hockey wrote:My next question: In sending mass customized emails (unique body, subject, etc) how would you suggest utilizing Swift to it's most efficient capability? Do I keep track of the mailing queue using PHP and a cron? I was hoping to just send all the messages to SMTP server and let the MTA worry about messages after that, but it sounds/looks like I will have to manually manage the list keeping track of which email addresses have been sent an email, etc???

Cheers :)
The MTA just delivers what you tell it to. If you need to control the rate at which messages are unspooled you can change the time between queue runs in the MTA configuration but really you want to load balance on the sending server (running Swift). As for message customization Swift provides classes to deal with this but yes, you will will effectively have to handle the list yourself.

What exactly is it you're doing? After answering all your questions it sounds like you need GNU Mailman.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Re: Mass emails

Post by alex.barylski »

d11wtq wrote:
Hockey wrote:I've looked over the docs (you've done a great job BTW - very clear)
Thanks :)
Hockey wrote:In looking to implement bounce detection. It looks like you suggest two methods:

1) Checking SMTP return code
2) Parsing a email sent back to bounce@whatever.com
1) That's not really bounce detection if it fails at SMTP-time. A bounce is a message the looks to have been accepted but is later failed.
2) Correct.
Hockey wrote:The latter sounds like a PITA because each different mail server formats the message differently? Can you confirm this? Is this each MTA (Exim, Postfix, sendmail, etc)?
Correct. But it's not even as simple as a postfix message looking one way and a exim one another way. It's configurable so you really don't know what to expect. It's probably best to simply scan any messages coming back on that address for email addresses.
Hockey wrote:So really, there is a fixed number of replies you can receive? Is this something which could be built into Swift, via plugins or similar? Or would it be considered something entirely separate?
There's no fixed number of bounce formats. It could be anything at all. It's also completely out of the scope of what Swift is for. If I was to write such a tool it would be a seperate project since reading emails is in no way shape or form the same as sending them.
Hockey wrote:By parsing the email, do you really get more details about the bounce? What If I was just interested in a bounce period could I not just extract the standardized email headers (from, etc)?
There's no standard for it. No RFC, nothing. Usually the messages tell you *why* it failed though yes. You'll often get a message every 24 hours for up to 5 days too.
Hockey wrote:My next question: In sending mass customized emails (unique body, subject, etc) how would you suggest utilizing Swift to it's most efficient capability? Do I keep track of the mailing queue using PHP and a cron? I was hoping to just send all the messages to SMTP server and let the MTA worry about messages after that, but it sounds/looks like I will have to manually manage the list keeping track of which email addresses have been sent an email, etc???

Cheers :)
The MTA just delivers what you tell it to. If you need to control the rate at which messages are unspooled you can change the time between queue runs in the MTA configuration but really you want to load balance on the sending server (running Swift). As for message customization Swift provides classes to deal with this but yes, you will will effectively have to handle the list yourself.

What exactly is it you're doing? After answering all your questions it sounds like you need GNU Mailman.
phpList, Mailman, etc are essentially what I am wanting to develop.
Post Reply