If you are using 1 domain and 2 different servers for email and web, you will have the issue from the web server, because you can't receive any emails from your webserver.
The root problem could be your server is considering your domain example.com email accounts as local accounts, you can solve that issue by some methods.
- If you are using Sendmail, you can read these posts:
- http://serverfault.com/questions/65365/disable-local-delivery-in-sendmail
- http://serverfault.com/questions/102647/sendmail-to-local-domain-ignoring-mx-records-part-2
- http://lists.freebsd.org/pipermail/freebsd-questions/2004-September/057382.html
-
http://objectmix.com/sendmail/367920-sendmail-ignores-mailertable-some-semilocal-domains.html
- If you are using Postfix, you can do this:
- connect to your server via ssh.
- edit your main.cf file :
nano /etc/postfix/main.cf
- comment the following line with # :
# mydestination = ...
- add at the end of the main.cf document :
mydestination =
- reload your postfix configuration by running :
/etc/init.d/postfix reload
- If you are using Cpanel:
Adding the MX records into the cPanel.
- Enter into the cPanel
- Go the the cPanel Mail section
- Search for MX Entry Maintenance, sometimes there is no text above the icon.
- Select the related domain
- Change Email Routing to Remote Mail Exchanger.
- Add all the google MX records as they are in your domain configuration using the appropriate priority values. You can check the records here and prioritieshttps://support.google.com/a/answer/174125
- Double check that Remote Mail Exchanger. is selected.
With this setting I was able to send email using mail PHP function to an email account inside the same domain as my website.
Google App instructions talking about MX records https://support.google.com/a/answer/54717?hl=en
After you did the above solution but it still doesn't work, you will need to update the resolv.conf file. It locates at /etc/resolv.conf
You can replace all content in that file by this:
nameserver 8.8.8.8
nameserver 8.8.4.4
After that, you need to restart the Network Manager service by this command:
service NetworkManager restart
Hope it will help you ^^
Revisions
- March 4, 2016 @ 16:36:31 [Current Revision] by admin
- March 4, 2016 @ 16:36:31 by admin
- March 4, 2016 @ 16:32:36 by admin
- February 29, 2016 @ 18:00:41 by admin
- February 29, 2016 @ 17:56:59 by admin
- February 29, 2016 @ 17:56:27 by admin
- February 29, 2016 @ 17:56:01 [Autosave] by admin
- February 29, 2016 @ 17:54:44 by admin
Revision Differences
February 29, 2016 @ 18:00:41 | Current Revision | ||
---|---|---|---|
Content | |||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: If you are using 1 domain and 2 different servers for email and web, you will have the issue from the web server, because you can't receive any emails from your webserver. | Unchanged: If you are using 1 domain and 2 different servers for email and web, you will have the issue from the web server, because you can't receive any emails from your webserver. | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: The root problem could be your server is considering your domain example.com email accounts as local accounts, you can solve that issue by some methods. | Unchanged: The root problem could be your server is considering your domain example.com email accounts as local accounts, you can solve that issue by some methods. | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: - If you are using Sendmail, you can read these posts: | Unchanged: - If you are using Sendmail, you can read these posts: | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <ul> | Unchanged: <ul> | ||
Unchanged: <li> | Unchanged: <li> | ||
Unchanged: <a href="http:// serverfault.com/questions/ 65365/disable- local-delivery- in-sendmail"> http://serverfault.com/ questions/65365/ disable-local- delivery-in-sendmail</a> | Unchanged: <a href="http:// serverfault.com/questions/ 65365/disable- local-delivery- in-sendmail"> http://serverfault.com/ questions/65365/ disable-local- delivery-in-sendmail</a> | ||
Unchanged: </li> | Unchanged: </li> | ||
Unchanged: <li> | Unchanged: <li> | ||
Unchanged: <a href="http:// serverfault.com/questions/ 102647/sendmail-to-local- domain-ignoring-mx-records- part-2">http: //serverfault.com/ questions/102647/sendmail- to-local-domain-ignoring- mx-records-part-2</a> | Unchanged: <a href="http:// serverfault.com/questions/ 102647/sendmail-to-local- domain-ignoring-mx-records- part-2">http: //serverfault.com/ questions/102647/sendmail- to-local-domain-ignoring- mx-records-part-2</a> | ||
Unchanged: </li> | Unchanged: </li> | ||
Unchanged: <li> | Unchanged: <li> | ||
Unchanged: <a href="http:// lists.freebsd.org/pipermail/ freebsd-questions/ 2004-September/ 057382.html" rel="nofollow" >http://lists.freebsd.org/ pipermail/freebsd-questions/ 2004-September/ 057382.html</a> | Unchanged: <a href="http:// lists.freebsd.org/pipermail/ freebsd-questions/ 2004-September/ 057382.html" rel="nofollow" >http://lists.freebsd.org/ pipermail/freebsd-questions/ 2004-September/ 057382.html</a> | ||
Unchanged: </li> | Unchanged: </li> | ||
Unchanged: <li> | Unchanged: <li> | ||
Unchanged: <a href="http:// objectmix.com/ sendmail/367920- sendmail-ignores- mailertable- some-semilocal- domains.html" rel="nofollow" >http://objectmix.com/sendmail/ 367920-sendmail- ignores-mailertable- some-semilocal- domains.html</a><br /> | Unchanged: <a href="http:// objectmix.com/ sendmail/367920- sendmail-ignores- mailertable- some-semilocal- domains.html" rel="nofollow" >http://objectmix.com/sendmail/ 367920-sendmail- ignores-mailertable- some-semilocal- domains.html</a><br /> | ||
Unchanged: | Unchanged: | ||
Unchanged: </li> | Unchanged: </li> | ||
Unchanged: </ul> | Unchanged: </ul> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: - If you are using Postfix, you can do this:<br /> | Unchanged: - If you are using Postfix, you can do this:<br /> | ||
Unchanged: | Unchanged: | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <ol> | Unchanged: <ol> | ||
Unchanged: <li> | Unchanged: <li> | ||
Unchanged: connect to your server via ssh. | Unchanged: connect to your server via ssh. | ||
Unchanged: </li> | Unchanged: </li> | ||
Unchanged: <li> | Unchanged: <li> | ||
Unchanged: edit your <b> main.cf</b> file : | Unchanged: edit your <b> main.cf</b> file : | ||
Unchanged: </li> | Unchanged: </li> | ||
Unchanged: </ol> | Unchanged: </ol> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: <code>nano /etc/postfix/ main.cf</code> | Unchanged: <code>nano /etc/postfix/ main.cf</code> | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <ol start="3"> | Unchanged: <ol start="3"> | ||
Unchanged: <li> | Unchanged: <li> | ||
Unchanged: comment the following line with <b> #</b> : | Unchanged: comment the following line with <b> #</b> : | ||
Unchanged: </li> | Unchanged: </li> | ||
Unchanged: </ol> | Unchanged: </ol> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: <code># mydestination = ...</code> | Unchanged: <code># mydestination = ...</code> | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <ol start="4"> | Unchanged: <ol start="4"> | ||
Unchanged: <li> | Unchanged: <li> | ||
Unchanged: add at the end of the <b>main.cf< /b> document : | Unchanged: add at the end of the <b>main.cf< /b> document : | ||
Unchanged: </li> | Unchanged: </li> | ||
Unchanged: </ol> | Unchanged: </ol> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: <code>mydestination = </code> | Unchanged: <code>mydestination = </code> | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <ol start="5"> | Unchanged: <ol start="5"> | ||
Unchanged: <li> | Unchanged: <li> | ||
Unchanged: reload your postfix configuration by running : | Unchanged: reload your postfix configuration by running : | ||
Unchanged: </li> | Unchanged: </li> | ||
Unchanged: </ol> | Unchanged: </ol> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: <code>/etc/init.d/postfix reload</code> | Unchanged: <code>/etc/init.d/postfix reload</code> | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: | Unchanged: | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: <font face="monospace">- If you are using Cpanel:</font> | Unchanged: <font face="monospace">- If you are using Cpanel:</font> | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: Adding the MX records into the cPanel. | Unchanged: Adding the MX records into the cPanel. | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <ol> | Unchanged: <ol> | ||
Unchanged: <li> | Unchanged: <li> | ||
Unchanged: Enter into the cPanel | Unchanged: Enter into the cPanel | ||
Unchanged: </li> | Unchanged: </li> | ||
Unchanged: <li> | Unchanged: <li> | ||
Unchanged: Go the the cPanel Mail section | Unchanged: Go the the cPanel Mail section | ||
Unchanged: </li> | Unchanged: </li> | ||
Unchanged: <li> | Unchanged: <li> | ||
Unchanged: Search for MX Entry Maintenance, sometimes there is no text above the icon. | Unchanged: Search for MX Entry Maintenance, sometimes there is no text above the icon. | ||
Unchanged: </li> | Unchanged: </li> | ||
Unchanged: <li> | Unchanged: <li> | ||
Unchanged: Select the related domain | Unchanged: Select the related domain | ||
Unchanged: </li> | Unchanged: </li> | ||
Unchanged: <li> | Unchanged: <li> | ||
Unchanged: Change < strong>Email< /strong> Routing to <strong>Remote Mail Exchanger.</strong> | Unchanged: Change < strong>Email< /strong> Routing to <strong>Remote Mail Exchanger.</strong> | ||
Unchanged: </li> | Unchanged: </li> | ||
Unchanged: <li> | Unchanged: <li> | ||
Unchanged: Add all the google MX records as they are in your domain configuration using the appropriate priority values. You can check the records here and priorities<a href="https:/ /support.google.com/a/answer/ 174125">https: //support.google.com/ a/answer/174125</a> | Unchanged: Add all the google MX records as they are in your domain configuration using the appropriate priority values. You can check the records here and priorities<a href="https:/ /support.google.com/a/answer/ 174125">https: //support.google.com/ a/answer/174125</a> | ||
Unchanged: </li> | Unchanged: </li> | ||
Unchanged: <li> | Unchanged: <li> | ||
Unchanged: Double check that <strong>Remote Mail Exchanger.</strong> is selected. | Unchanged: Double check that <strong>Remote Mail Exchanger.</strong> is selected. | ||
Unchanged: </li> | Unchanged: </li> | ||
Unchanged: </ol> | Unchanged: </ol> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: With this setting I was able to send email using mail PHP function to an email account inside the same domain as my website. | Unchanged: With this setting I was able to send email using mail PHP function to an email account inside the same domain as my website. | ||
Unchanged: </p> | Unchanged: </p> | ||
Unchanged: <p> | Unchanged: <p> | ||
Unchanged: Google App instructions talking about MX records <a href="https:/ /support.google.com/a/answer/ 54717?hl=en"> https://support.google.com/ a/answer/54717?hl=en</a> | Unchanged: Google App instructions talking about MX records <a href="https:/ /support.google.com/a/answer/ 54717?hl=en"> https://support.google.com/ a/answer/54717?hl=en</a> | ||
Added: </p> | |||
Added: <p> | |||
Added: | |||
Added: </p> | |||
Added: <p> | |||
Added: After you did the above solution but it still doesn't work, you will need to update the resolv.conf file. It locates at /etc/resolv.conf | |||
Added: </p> | |||
Added: <p> | |||
Added: You can replace all content in that file by this: | |||
Added: </p> | |||
Added: <p> | |||
Added: nameserver 8.8.8.8<br /> | |||
Added: nameserver 8.8.4.4 | |||
Added: </p> | |||
Added: <p> | |||
Added: After that, you need to restart the Network Manager service by this command: | |||
Added: </p> | |||
Added: <p> | |||
Added: service NetworkManager restart | |||
Added: </p> | |||
Added: <p> | |||
Added: Hope it will help you ^^ | |||
Unchanged: </p> | Unchanged: </p> |
Note: Spaces may be added to comparison text to allow better line wrapping.
No comments yet.