Post by reynafabrics » Tue Jan 09, 2018 7:01 pm

Hi,
My site running on 2.0.3.1 version. I am having issue with email notification. I am not getting notification emails while sign up, order confirmation etc.
I have done general R&D like
1) Mail/SMTP configuration with and without -f parameters SMTP Port.
2) Checked for both Gmail account and personal domain account
3) Set email as registered email for sending mails via scripts (hostgator)
4) Added code sendmail_path = /usr/sbin/sendmail -t -i; in root and admin php.ini file

Then I changed,

Code: Select all

$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?=' . ' <' . $this->from . '>' . $this->newline;
from system/library/mail.php

Code: Select all

//$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?=' . ' <' . $this->from . '>' . $this->newline;
$header .= 'From: XXXXX@mydomain.com' . $this->newline;
It works!!

posted for reference only as I suffered a lot and I don't want for others.....
Last edited by straightlight on Thu Apr 23, 2020 7:40 pm, edited 1 time in total.
Reason: Added code tags.

Newbie

Posts

Joined
Thu Sep 07, 2017 9:38 pm


Post by straightlight » Wed Jan 10, 2018 7:31 am

There is already an existing extension on the marketplace that resolves this issue without having to manually set your email. This problem is rather related with the base64 encoding for some hosts.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by reynafabrics » Wed Jun 06, 2018 6:06 pm

straightlight wrote:
Wed Jan 10, 2018 7:31 am
There is already an existing extension on the marketplace that resolves this issue without having to manually set your email. This problem is rather related with the base64 encoding for some hosts.

I have just changed the following code at system/library/mail.php
It works for me and I hope it will helpful to someone.


Original:

Code: Select all

$header .= 'Date: ' . date('D, d M Y H:i:s O') . $this->newline;
$header .= 'From: ' . '=?UTF-8?B?' . base64_encode($this->sender) . '?=' . ' <' . $this->from . '>' . $this->newline;
$header .= 'Reply-To: ' . '=?UTF-8?B?' . base64_encode($this->sender) . '?=' . ' <' . $this->from . '>' . $this->newline;
$header .= 'Return-Path: ' . $this->from . $this->newline;
$header .= 'X-Mailer: PHP/' . phpversion() . $this->newline;
$header .= 'Content-Type: multipart/related; boundary="' . $boundary . '"' . $this->newline . $this->newline;
Changed:

Code: Select all

$header .= 'Date: ' . date('D, d M Y H:i:s O') . $this->newline;
//$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?=' . ' <' . $this->from . '>' . $this->newline;
$header .= 'From: email@yourdomainname.com' . $this->newline;
if (!$this->reply_to) {
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->sender) . '?=' . ' <' . $this->from . '>' . $this->newline;
} else {
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->reply_to) . '?=' . ' <' . $this->from . '>' . $this->newline;
}
$header .= 'Return-Path: ' . $this->from . $this->newline;
$header .= 'X-Mailer: PHP/' . phpversion() . $this->newline;
$header .= 'Content-Type: multipart/related; boundary="' . $boundary . '"' . $this->newline . $this->newline;
Last edited by straightlight on Thu Apr 23, 2020 7:31 pm, edited 1 time in total.
Reason: Added code tags.

Newbie

Posts

Joined
Thu Sep 07, 2017 9:38 pm


Post by mnstradelinks » Thu Apr 23, 2020 6:35 pm

straightlight wrote:
Wed Jan 10, 2018 7:31 am
There is already an existing extension on the marketplace that resolves this issue without having to manually set your email. This problem is rather related with the base64 encoding for some hosts.
Is it true that extension may increase the loading time of the website?
If yes, so in that case changing the core file will be the best option.
If no, can you please share the extension name so that it will be a great help for beginners.

Newbie

Posts

Joined
Thu Apr 23, 2020 6:19 pm

Who is online

Users browsing this forum: No registered users and 3 guests