I've setup two mail servers 1. Gmail sever for handling certain email of my domain.com 2. A custom sendgrid inbound parse that also accepts certain email for my domain.com
Now I've two MX records on DNS setting for both mail servers. but I see only one is working . That one works which priority is only 1. Even I tried setting both priority to 1 only one works. How can I make it working send on both. Or can i create some custom service that forwards mail to mail server depending on from_email address ?
Mail will always be sent to just 1 mailserver, which is chosen by the priorities of your MX records.
To be able to use 2 mailservers for 1 domain you can have a look at Split-Domain Routing (SDR)