1. Set the sender name and sender email of general contact in system-> Configuration-> store email addresses.
Sender name is the sender of the email, and sender email is the sender's email address.
2. Configure mail sending settings in system> Configuration> system. The configuration is as follows:
At present, I do not understand the role of set return-path. I will add instructions later.
3. Override the getmail () method in mage_core_model_email_template (APP/code/CORE/MAGE/CORE/model/email/template. php,
Public Function getmail ()
{
If (is_null ($ this-> _ mail )){
$ My_smtp_host = Mage: getstoreconfig ('System/SMTP/host ');
$ My_smtp_port = Mage: getstoreconfig ('System/SMTP/port ');
$ Config = array (
'Port' => $ my_smtp_port,
'Auth' => 'login ',
'Username' => 'smtp server username ',
'Password' => 'smtp server password'
);
$ Transport = new zend_mail_transport_smtp ($ my_smtp_host, $ config );
Zend_mail: setdefaulttransport ($ transport );
/* Changes end */
$ This-> _ mail = new zend_mail ('utf-8 ');
}
Return $ this-> _ mail;
}
4. Modify the email template
Magento's default mail template is located in APP/locale/en_us/template/email. The system uses the template in the language not available for calling the current store.
(1) Add a mail template to system-> transactional emails, and select the template from system-> Configuration-> customer configuration-> Create new account options.