What I am trying to do is sending a newsletter with HTML content. So, the user fill a textfiend and a textarea for title and text of the newsletter, the controller should get those values and passes them to a function that put those 2 parameters inside the HTML code, then use the result as a body of the email.
How can I do that?
If I understood you right, the problem is to send HTML inside the letter. This could be simply done with extension http://www.yiiframework.com/extension/mail/ .
Also, it’s easy to send html inside emails just with mail() PHP function - http://php.net/manual/en/function.mail.php - see 4th example here.
you got all basic detail here
if you using extension i recomondate This email extension