Skip Navigation LinksHome > Categories > Code from a Category

Zend Mail: Send e-mail through the Zend Framework

User Name: serfcompany
Name: Serf
Contact Me:
Home Page:
php,mysql,javascript,html,css. Preferable working with Zend Framework. Good know javascript. I worked with various, javascript frameworks such as(jquery, YUI3, extjs, sencha touch). [More]
Viewed Times: 3314
Add Date: 06/28/2012
This article will be considered one of the ways to transfer e-mail through Zend Mail class.

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.

Post a Comment

Name: (Optional)
Email: (Optional, you can get an email if somebody replys your comments)*
Email me if somebody respons my comment below:
Enter Text
as Below:
(case insensitive, if hard to read, click the "get a new one" button)
* Your email address will not be shared with any third parties for any reason.
** Maximum 1000 charactors.