I had some issues today using the cakephp swiftmailer component. It still relied on the older version (pre version 3) of swiftmailer. There are quite some changes between SwiftMailer 2 and 3, and I decided to adjust the SwiftMailer component so it works with SwiftMailer 3.
Please note that this is the PHP5 version. To get it working in PHP4, you need to change the constants in the connect_sendmail and connect_smtp…
Download CakePHP SwiftMailer 3 Component.


Hi, found an error i think:
Line 213:
$message->attach should be $this->message->attach
Jason,
Thanks for the feedback. I have updated the swift_mailer script. It also supports SMTP authentication now…
Hi, there’s an error here, took me aaaaages to find this!
Line 249:
if($type == ‘html’){
$this->message->attach(new Swift_Message_Part($msg, “text/plain”));
}else{
$this->message->attach(new Swift_Message_Part($msg, “text/html”));
}
The ‘text/html’ and ‘text/plain’ are the wrong way round!!
@Wouter: Thanks so much for a SwiftMailer3 port. You just saved me a ton of time.
@Adam: Good call! Thanks – that was a big help.
i’m trying to using this code with cake 1.2 stable, it sends a message but body is empty, any idea?
“i’m trying to using this code with cake 1.2 stable, it sends a message but body is empty, any idea?”
I’m having the same issue…
The component doesn’t support cake 1.2 for now. Cake itself comes with a good email component now: http://book.cakephp.org/view/176/Email
wouter as I know cake emailComponent is using mailPHP so without SSL support :/