Hi, @Amol Pande
Given that everything is fine when you assign internet from the primary isp through the firewall, the exchange server should not be a problem.
The problem may be in the way the Sonicwall 3650 firewall handles traffic.
Based on this situation it is recommended that you perform the following troubleshooting:
1.Ensure that both Exchange servers are able to resolve DNS names when using a secondary ISP. You may need to configure the DNS settings on the server or firewall to use the public DNS servers when the secondary ISP is active.
2.Ensure that the SonicWall 3650 has the necessary rules to allow outbound SMTP traffic (typically TCP port 25) when using the secondary ISP. Check to see if there are any restrictive rules that only allow outbound mail traffic to flow through the primary ISP.
3.Verify that NAT policies are properly configured for both ISPs. Ensure that NAT rules exist to handle outbound traffic for mail services when using the secondary ISP.
4.Check the firewall logs for any errors or blocked traffic when switching to the secondary ISP.
5.If possible temporarily disable the firewall and test with the secondary ISP to see if there are any errors.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".