Swift Mailer

Hi everyone,

I’ve found a great library for sending mail which in my opinion beats php mailer by a lot, to easy access it with Yii

i made this wrapper with some helper methods added to it. Easy to use and so far seems very robust.

Quoting the authors page

[i]Swift Mailer integrates into any web app written in PHP 5, offering a flexible and elegant object-oriented approach to sending emails with a multitude of features.

  • Send emails using SMTP, sendmail, postfix or a custom Transport implementation of your own

  • Support servers that require username & password and/or encryption

  • Protect from header injection attacks without stripping request data content

  • Send MIME compliant HTML/multipart emails

  • Use event-driven plugins to customize the library

  • Handle large attachments and inline/embedded images with low memory use[/i]

Hopefully more people than me will find this useful.

I appreciate all kinds of feedback!


Fyi: http://www.yiiframework.com/extension/mail/

I plan on also trying out your implementation

Crap! :(

How could i’ve missed that. After tying mine out, you make the call if we even need mine in repo.

Better off removing it if there’s no real difference, i don’t see the purpose of maintaining two of the

same extensions. :)



Probably it’s good idea to review jonah’s extension to merge your code or optimize existing code.

I’ve reviewed Jonah’s code and my approach is just a simple wrapper with a few helper methods to the Swift classes whilst Jonah

did a more thorough job adding a couple of other helpers and debug component etc. I myself will stick to my implementation

because i don’t need all that Jonah has, but on the other hand if i knew it was available in the first place i wouldn’t have cared and

used it so you are free to delete this thread and my component if you see it useless being as it is. I don’t mind at all! B)

I haven’t gotten a chance to try this yet but… We’re not going to delete this thread or this extension, unless you want us to (but I don’t think you should, you did a great job)



I think it should be either merged or deleted. Two extensions doing the same thing is the bad situation.


I have to agree, i don’t really see the need for my extension when Jonah’s exist, feel free to delete this as i

couldn’t find any way of doing it myself. :)

Ok. I’m going to take a good look at this once my school finals end , next week (right now I don’t have much time)

Is it possible just to update the SwiftMailer lib files to always have the latest version or did you make any changes in the SwiftMailer files?

This question refers to both Yii Swift Mailer extensions.