Answered by:
Send eml file in email

Question
-
Currently, I have an email application and I want to add send messages with .eml but not as attached file without from, to content. I don't know where to start. My first idea was extract message from .eml file and return CDO message. I need to add to the message from eml file to MailMessage classTuesday, January 19, 2016 2:18 PM
Answers
-
Your gramatic is off, so I still am not certain what you talk about.
Please give an example for what you have on disk (what he .eml file contains) and how the send mail should look like. Or consider asking this in your native language.You add a Message to a Email by setting the message field/property to whatever you want.
There is a definition to put images inline into HTML code. You could use this way to "inline" the images into a HTML Email.
However:
a) HTML mails are frowned upon
b) inline images are even frowned upon for HTML pages
c) not every email client supports this display properly. (Outlook is known to just display inline images as if they were attachments to begin with, for example).
If you want to make a newsletter the Formula is:
Make a HTML page and publish it on a server. Inlcuding non-inline images on the same server.
Write a Mail message in HTML format with the following content:
"If this is not properly displayed, please follow this link [link to the page you made above]"
The same HTML you used for the HTML page, inlcuding the fully qualified links to the images on the server.
"If you want to unsibscribe please use this link [link to a webpage/script that will remove that person from teh mail list]".- Edited by Christopher84 Tuesday, January 19, 2016 5:48 PM
- Proposed as answer by Kristin Xie Friday, January 29, 2016 9:38 AM
- Marked as answer by Kristin Xie Monday, February 1, 2016 9:33 AM
Tuesday, January 19, 2016 5:47 PM
All replies
-
What is your goal here?
Because it sounds like you are on a very wrong track to solve a real issue. What you want to do might be nearly unfeasible/unreliable or have a much, much better solution.
Is this about automatically sending mails (time delayed, multiple receivers, automatic "I am away"-message)?
That should be done by the Mail Server itself. Doing this with user code is usually a very terrible idea.Why do you even work with .eml files, a single file export format for Emails?
Why are you not working with the Mails on the server itself? Why are you not working as Plugin in the Mail programm itself?Tuesday, January 19, 2016 3:25 PM -
About the only method worth trying is explained in the following TechNet article that does not contain code but gives you the how and pitfalls of sending a eml file through Microsoft Exchange
https://technet.microsoft.com/en-us/library/bb124230(v=exchg.150).aspx
The following is a decent Code Project article done in C# but let's bypass the actual code and look at the comments at the end of article, lots of things can go aerie
http://www.codeproject.com/Articles/76607/Easily-Retrieve-Email-Information-from-EML-Files-R
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
Tuesday, January 19, 2016 3:38 PM -
Basically I need need to add to the message content(with photos) from eml file to MailMessage class. It's possible? How?Tuesday, January 19, 2016 5:03 PM
-
Your gramatic is off, so I still am not certain what you talk about.
Please give an example for what you have on disk (what he .eml file contains) and how the send mail should look like. Or consider asking this in your native language.You add a Message to a Email by setting the message field/property to whatever you want.
There is a definition to put images inline into HTML code. You could use this way to "inline" the images into a HTML Email.
However:
a) HTML mails are frowned upon
b) inline images are even frowned upon for HTML pages
c) not every email client supports this display properly. (Outlook is known to just display inline images as if they were attachments to begin with, for example).
If you want to make a newsletter the Formula is:
Make a HTML page and publish it on a server. Inlcuding non-inline images on the same server.
Write a Mail message in HTML format with the following content:
"If this is not properly displayed, please follow this link [link to the page you made above]"
The same HTML you used for the HTML page, inlcuding the fully qualified links to the images on the server.
"If you want to unsibscribe please use this link [link to a webpage/script that will remove that person from teh mail list]".- Edited by Christopher84 Tuesday, January 19, 2016 5:48 PM
- Proposed as answer by Kristin Xie Friday, January 29, 2016 9:38 AM
- Marked as answer by Kristin Xie Monday, February 1, 2016 9:33 AM
Tuesday, January 19, 2016 5:47 PM