0
votes

I am using the Mail function in opencart->settings->mail

But when i placed demo order on my site, i am getting email confirmation as below FROM address:

<[email protected]>; on behalf of; Domain <[email protected]>

I tried editing mail.php (system/library/mail.php) as below:

FROM

    $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;

TO

    $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 protected]' . $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;

Still i am getting the email like above only.

<[email protected]>; on behalf of; Domain <[email protected]>

Could anybody please help as this discloses hosting information to the customers and creates privacy issues.

1
I guess this more for the hosting support and hosting mail-server configuration... - shadyyx

1 Answers

0
votes

This happens when you use mail instead of smtp, as mail is an open relay and allows you to set From as you wish you always get the via. So everything is really ok, if you wish to not have this in your emails you should use SMTP in your setting in admin back-end.

So in short:

Go to System -> settings

Edit your main site

Got to Mail tab

You should specify SMTP as Mail Protocol

Specify correct data for : SMTP Host, SMTP Username, SMTP Password

And you are done.