I am not sure if there is a tweak or utility that would do the following.

My iphone and ipad uses carrier A and home wifi is through carrier B. I have an email account with A and B.

The problem is that emails will not be sent via a relay ISP. That means when I am sending through email account with A, I cannot send it through my wifi carrier B. Likewise, if I send through my email from account B, I cannot sned it via carrier A (I need wifi coverage).

Is there a tweak that could work out which account to use if I have wifi coverage or not and select the appropriate account to use?