c# - Trying to create an email process that receives an email and replies to the sender with their sent email included as an attachment -


i'm using c# / visual studio 2012 create email process replies sender of email original email attachment. when error occurs while processing email send. i'm using stock .net system.net.mail.mailmessage , system.net.mail.smtpclient.

i take original email eml, , construct memorystream contents of email eml:

memstream = new memorystream(encoding.ascii.getbytes(exception.emaileml)); memstream.seek(0, seekorigin.begin); 

i construct email , try adding attachment follows:

 message.attachments.add(new attachment(contentstream,                     system.net.mime.mediatypenames.text.plain));                 message.attachments[0].name = subject + ".msg"; 

in outlook, see message attachment, outlook isn't able open attachment. error outlook...

is matter of setting correct mime type .msg attachment opens in outlook, or else need do?

when review .msg attachment within text editor, see following in header:

received: server.com ([___])  server.com ([___]) mapi id  ___; mon, 25 mar 2013 23:00:20 -0400 from: me <myemailaddy> to: server side mailbox process <processemailaddy> subject: subject text thread-topic: topic text thread-index: ac4pzgz84kk07lidq+uir67iwbosxw== date: mon, 25 mar 2013 23:00:20 -0400 message-id:  <4b10588a111f814e992da95c07ad4f5e0ca102@server.com> accept-language: en-us content-language: en-us x-ms-exchange-organization-authas: internal x-ms-exchange-organization-authmechanism: 04 x-ms-exchange-organization-authsource: server.com x-ms-has-attach: x-ms-exchange-organization-scl: -1 x-ms-tnef-correlator: content-type: text/html; charset="us-ascii" mime-version: 1.0 

thanks!

my bad, email source in eml format. attaching file email eml extenion now. critical path in case working approach!


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -