title: Conditionally Prevent Outlook from Sending Email Based on From and Recipient Addresses
body: <p>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).</p>
  
  <p>These restrictions between from (my selected mail account) and recipient (To or CC) email addresses can generally be defined by domain name.</p>
  
  <p>For example, johndoe@domainA.com should not send to recipient-domainX.com &amp; recipient-domainY.com.  And johndoe@domainB.com should not send to recipient-domain1.com &amp; recipient-domain2.com.</p>
  
  <p>So it would be fine to explicitly define or "hardcode" these domain restrictions per mail account in a VBA script or text file.</p>
  
  <p>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.</p>
  
  <p>Open to other more elegant solutions as well.</p>
  
  <p>Thanks.</p>