For convenience and ability to create your own templates to send mail, create your own class, which will empower Zend Mail.
Now add the settings to work with Zend Mail in application.ini.
Specifying the path to the files - Mail templates. If necessary we can also specify the data to connect to smtp server.
Now prodemostruyu code with which you can send an email through the Zend Mail:
Next, create a template for the specified topic in the file directory application.ini - contact.subj.tpl:
And the letter itself - contact.tpl:
Where the variables are, respectively, as the% 2 $ s and% 1 $ s, depending on the order in which they are given.
In case you need to add Zend Mail attachment, you can do it this way:
That's all, thank you for your attention.