I have multiple mail accounts setup in Outlook 2007 (e.g., johndoe@domainA.com, johndoe@domainB.com, etc.). Occasionally, usually as the result of the Auto Complete feature, I will mistakenly send email from johndoe@domainA.com to a recipient that should only be receiving mail from johndoe@domainB.com).
These restrictions between from (my selected mail account) and recipient (To or CC) email addresses can generally be defined by domain name.
For example, johndoe@domainA.com should not send to recipient-domainX.com & recipient-domainY.com. And johndoe@domainB.com should not send to recipient-domain1.com & recipient-domain2.com.
So it would be fine to explicitly define or "hardcode" these domain restrictions per mail account in a VBA script or text file.
So how, using VBA or other means, can I implement a check of the email addresses, to prevent an email from being sent if one of these restrictions is being violated.
Open to other more elegant solutions as well.
Thanks.