Opencart 2.0 email doesn’t send

To fix the email issue in opencart 2.0 do the following changes on in necessary model file,

$mail = new Mail();
$mail->protocol = $this->config->get(‘config_mail_protocol’);
$mail->parameter = $this->config->get(‘config_mail_parameter’);
//$mail->smtp_hostname = $this->config->get(‘config_mail_smtp_host’);

The above line should be changed as below

$mail->smtp_hostname = $this->config->get(‘config_mail_smtp_hostname’);
$mail->smtp_username = $this->config->get(‘config_mail_smtp_username’);
$mail->smtp_password = html_entity_decode($this->config->get(‘config_mail_smtp_password’), ENT_QUOTES, ‘UTF-8’);
$mail->smtp_port = $this->config->get(‘config_mail_smtp_port’);
$mail->smtp_timeout = $this->config->get(‘config_mail_smtp_timeout’);

$mail->setTo($this->request->post[’email’]);
$mail->setFrom($this->config->get(‘config_email’));
$mail->setSender(html_entity_decode($this->config->get(‘config_name’), ENT_QUOTES, ‘UTF-8’));
$mail->setSubject($subject);
$mail->setText($message);
$mail->send();

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s