Persistent connection

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
Kaitlyn2004
Forum Newbie
Posts: 15
Joined: Wed May 30, 2007 7:46 am

Persistent connection

Post by Kaitlyn2004 »

If I want to send a different message to multiple subscribers, can SwiftMailer do this? Or does it need to reconnect for each e-mail?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Swift uses a persistent connection. You have to call $swift->disconnect() if you want to close the connection.
chaac
Forum Newbie
Posts: 1
Joined: Tue Jul 22, 2008 1:13 pm

Re: Persistent connection

Post by chaac »

What if I do this:

$swift =& new Swift(new Swift_Connection_SMTP("smtp.your-host.tld"));
//Create the message
$message =& new Swift_Message("My subject", "My body");
$swift->send($message, "foo@bar.tld", "me@mydomain.com");

$swift2 =& new Swift(new Swift_Connection_SMTP("smtp.your-host.tld"));
//Create the message
$message2 =& new Swift_Message("My subject", "My body");
$swift2->send($message, "foo@bar.tld", "me@mydomain.com");

Will I get two connections?
Post Reply