OpenCart - not sending emails (notifications or contact page)

前端 未结 5 2030
走了就别回头了
走了就别回头了 2021-01-15 17:03

As far as I can tell, my mail settings are configured correctly but I\'m not receiving any emails, not through the contact form, nor for new customers or any orders that are

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-15 17:31

    The solution for me was that e-mails could not be sent by my server when they had a domain in the "from" that wasn't the same as the host.

    This was clear because when i filled in test@mydomain.com in the contact form, it works, and also the regular emails did arrive.

    In order to force the mails being sent from my own host instead of the filled in email address, I've edited the contact controller.

    Please do not continue with this if you do not know how to edit source code, I'm leaving out some simple steps. If you don't know these steps, dont ask, but ask a professional to look this up. (Just for your own protection)

    File: catalog/controller/information/contact.php

    Function index, for me on line 21:

    ORIGINAL:

    $mail->setFrom($this->request->post['email']);
    

    NEW:

    $mail->setFrom($this->config->get('config_email'));
    $mail->setReplyTo($this->request->post['email']);
    

    This solved it for me.

提交回复
热议问题