how to know if an email is an incoming one ? RRS feed

  • Question

  • Hi everyone, as indicated in the title, I am currently developing a Transport Agent that checks the presence of some values in the subject or the header, and I want to know if the message intercepted is an incoming mail or not. if it's outgoing then we skip the check. Thank you.
    Thursday, March 24, 2011 11:01 AM

All replies

  • Hi,

    Hmmm, there are a few header values you could check to do this but perhaps the easiest way to do this is to check if the sender's domain is in the list of accepted domains for the server.

    If it is the email is outgoing or local.... it it's not the email is incoming.

    You can enumerate or search the list of accepted domains from the SMTPServer object passed to the agent constructor (from the agent factory call CreateAgent).



    Friday, March 25, 2011 9:35 AM