Sending many emails
Moderators: Chris Corbyn, General Moderators
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
Sending many emails
I looked through the docs and the topics here and came up short. I want to send like 1000 emails (a newsletter) but my mail server can only take so much of course. How can I do this without loading all the people into 1 huge array and having swift just try to mail them all out at once?
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
Ok so I dont quite know how to use the anti flood plugin. This is my code as I think it should work:
this works for sending email to only 2 recipients but I dont have a list of 100 to test it on so I want to make sure it will work before i even try to send to our real email list.
Code: Select all
require('Swift/Swift.php');
require('Swift/Swift/Connection/SMTP.php');
require_once 'Swift/Swift/Plugin/AntiFlood.php';
$swift = new Swift(new Swift_Connection_SMTP('mail.mediapostinc.com'));
$swift->loadPlugin(new Swift_Plugin_AntiFlood);
if (!$swift->hasFailed())
{
$swift->addPart($NewsLetter['HTML'], 'text/html');
//Pass the array to send()
$swift->send(
$Emails,
'"MediaPostInc" <MediaPostInc@mediapostinc.com>',
'Media Post Inc Newsletter'
);
$swift->close();
}- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia