Jump to content

mail() function cannot send email to my own domain


Recommended Posts

Prestashop version: 1.5.6

Env: Godaddy, VPS, LAMP

 

I am using the PHP mail() function to send mails. It works fine to send to any domains' email address, EXCEPT my own domain's. And the most suprising thing is that the method Mail:send() returns true...

 

When It's 

 

Mail::Send($this->context->language->id, 'inquiry-to-customer', 'We have recieved your inquiry.', $emailData, $customerEmail(reciever, not my domain), $firstName.' '.$lastName, $saleEmail(sender, my domain), $saleName)

 

It returns true, and I can recieve the email.

the red ( ..... ) is annotation, not code.

 

But when it's

Mail::Send($this->context->language->id, 'inquiry-to-salesman', 'Inquiry for '.$productName." ".$inquiryNum, $emailData, $saleEmail(reciever, my web domain), $saleName, $customerEmail(not my domain), $firstName.' '.$lastName) 

 

It also returns true, but I cannot recieve any email.

 

Does anybody know how to solve this problem?

 

p.s. If I use SMTP option, I can recieve both emails.

 

 

Edited by JasonWang (see edit history)
Link to comment
Share on other sites

As you have a VPS account, why don't you see in the mail log (for postfix /var/log/maillog or /var/log/mail)

 

I kind of know what's happening. I'am using gmail server.

I looked up the mail record in cPanel. I found this.

one is success. the deliver user is "remote", means gmail server was handling this.

the other one is failure. I think its because the reciever is my own doaim, the deliver user is "sanford", means local host was handling it. so the report shows "no such user". 

 

How can I make the gmail server to handle the delivery when the reciever is of my own domain?

Already solved. Go to cPanel, change MX entry

Edited by JasonWang (see edit history)
Link to comment
Share on other sites

  • 1 year later...
  • 1 year later...

I kind of know what's happening. I'am using gmail server.

I looked up the mail record in cPanel. I found this.

one is success. the deliver user is "remote", means gmail server was handling this.

the other one is failure. I think its because the reciever is my own doaim, the deliver user is "sanford", means local host was handling it. so the report shows "no such user". 

 

How can I make the gmail server to handle the delivery when the reciever is of my own domain?

Already solved. Go to cPanel, change MX entry

Hi, I am facing the same problem..can you tell what changes you made to the MX Entry? Thanks in advance..

Link to comment
Share on other sites

×
×
  • Create New...