Category Archives: Uncategorized

Using Swift Mailer 4 in Symfony 1.3


cd lib/vender
wget http://swiftmailer.org/downloads/get/Swift-4.0.5.tar.gz
tar xzvf Swift-4.0.5.tar.gz
mv Swift-4.0.5/lib swift

Add to “config/ProjectConfiguration.class.php”
require_once dirname(__FILE__).'/../lib/vendor/swift/swift_required.php';

Using Swift 4

$this->transport = Swift_SmtpTransport::newInstance($server);
//$this->transport = Swift_MailTransport::newInstance();
$mailer = Swift_Mailer::newInstance($this->transport);
$message = Swift_Message::newInstance($subject)->setTo($to)->setFrom($from)->setBody($body,'text/html');
$mailer->send($message, $failures);