I am developing a contact form application that detects emails arriving into a certain email address. The MSOutlook client sees several email addresses and I am only interested in one of them.
To detect if the incoming email needs processing I use MAPI to compare the value of the header PR_RECEIVED_BY_EMAIL_ADDRESS with the address I am interested in, say fredbloggs@mydomain.co.uk and when it matches I know its one to be processed.
On my development machine (not connected to exchange) this works OK but on a machine that is connected to MSexchange the value of PR_RECEIVED_BY_EMAIL_ADDRESS is something like /O=INSTITUTIONNAME/OU=FIRST ADMINISTRATIVE GROUP/CN=RECIPIENTS/CN=FREDBLOGGS so my comparison fails and I don't see it as needing processing.
Please can someone explain the format of the PR_RECEIVED_BY_EMAIL_ADDRESS header? Can I always assume that the last part of it will be equal to the name before the @ symbol in the email address - and therefore I can use that to detect my special emails?
Also, does PR_RECEIVED_BY_EMAIL_ADDRESS still exist in 2007 2010 etc?
Finally, if this is not the best way to do this, what is a better way?
Howard
To detect if the incoming email needs processing I use MAPI to compare the value of the header PR_RECEIVED_BY_EMAIL_ADDRESS with the address I am interested in, say fredbloggs@mydomain.co.uk and when it matches I know its one to be processed.
On my development machine (not connected to exchange) this works OK but on a machine that is connected to MSexchange the value of PR_RECEIVED_BY_EMAIL_ADDRESS is something like /O=INSTITUTIONNAME/OU=FIRST ADMINISTRATIVE GROUP/CN=RECIPIENTS/CN=FREDBLOGGS so my comparison fails and I don't see it as needing processing.
Please can someone explain the format of the PR_RECEIVED_BY_EMAIL_ADDRESS header? Can I always assume that the last part of it will be equal to the name before the @ symbol in the email address - and therefore I can use that to detect my special emails?
Also, does PR_RECEIVED_BY_EMAIL_ADDRESS still exist in 2007 2010 etc?
Finally, if this is not the best way to do this, what is a better way?
Howard