如何从其他服务器的电子邮件接收电子邮件?

I'm building a simple email application and I already have everything almost done, the issue I've so far is that I cannot receive emails from other domains. To explain it:

  1. I've my domain: domain.tld

  2. I want to be able to manage @domain.tld, @anotherdomain.tld (in another server), @thirddomain.tld (in a different server).

  3. My email applications works just fine with @domain.tld accounts, I can create them, send emails and receive them with no issues. My problems comes when I try to use accounts using any of the other two domains, I'm able to send emails with those accounts just fine, the issue appears when I try to receive them, I always get a "no user found" or something like it, I already changed the MX records for those domains and set the response as mail.domain.tld; however, it's not working.

I'm using CPanel btw.

Thanks a lot!

If the code is working for one of the domains but not the other two, I'd guess that the propagation hasn't completed yet (if you have indeed changed to MX records). Remember not all the TTL's have the same time, therefore you might need to wait a little longer for the other two domains to propagate. What I would first of all do is check exactly where those domains point to. try this tool to find out where the domain is currently pointing to: http://mxtoolbox.com/