Send email in magento

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.