Swift mailer class
Moderators: Chris Corbyn, General Moderators
-
Pugalanthi
- Forum Newbie
- Posts: 6
- Joined: Tue Feb 19, 2008 12:09 am
Swift mailer class
Swift mailer class
-
Pugalanthi
- Forum Newbie
- Posts: 6
- Joined: Tue Feb 19, 2008 12:09 am
Re: Swift mailer class
Hi
In Swift mailer i want to send batch mailing,
But the subject and body will differ for every receipient.
Please give some idea to do it with swift mailer.
Thak in Advance
Pugalanthi.
In Swift mailer i want to send batch mailing,
But the subject and body will differ for every receipient.
Please give some idea to do it with swift mailer.
Thak in Advance
Pugalanthi.
Re: Swift mailer class
Have you looked at the Swift Mailer Docs?
http://swiftmailer.org/wikidocs/
http://swiftmailer.org/wikidocs/v3/plugin_decorator
http://swiftmailer.org/wikidocs/
http://swiftmailer.org/wikidocs/v3/plugin_decorator
Re: Swift mailer class
I guess you'll need to loop it to specify different subject+body.
Code: Select all
$smtp->new Swift_Connection_SMTP("mydomain.com", 25)
$smtp->setUsername("user");
$smtp->setpassword("pass");
$swift = new Swift($smtp);
# Not sure if this line has to be in the loop
$swift->attachPlugin(new Swift_Plugin_AntiFlood(100), "anti-flood");
$message = new Swift_Message();
$message->setContentType("text/html");
for ($i = 0; $i < $Total; $i++)
{
$message->setSubject($subject[$i]);
$message->setBody($body[$i]);
echo $recipient[$i].' : ';
if ($swift->send($message, $recipient[$i], "myname@mydomain.com"))
echo "Sent";
else
echo "Failed";
echo "\n";
# usleep(100);
}
$swift->disconnect();
Last edited by anjanesh on Thu Feb 28, 2008 11:13 am, edited 1 time in total.
Re: Swift mailer class
There is a Swift Mailer forum - I've moved this thread there.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.