Do with the below:
at the top of your file.
Also Yii comes already with swiftmailer, if you do not want to use it you can always just install a new mailer
this ones come with phpmailer already in the package. It also comes with a cronjob because you do not really want to send emails directly, it takes too long usually.
this ones integrates better with yii as a component
I personally use Mailchimp as it makes sending emails easy and I do not care to debug a mailserver when things do not go ok or when you are put on spam lists.