
https://gist.github.com/SelimBasyouni/efec48a197bfefb59d4ff75797aae15e
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello everyone,
Previously, we have been creating emails through our desktop applications, which can be edited and sent using various email programs. These emails, along with the recipients, subject, content, and attachments, are pre-formulated within our programs, and then the user can proceed to edit and send them.
However, as the "New Outlook" no longer supports, nor will it continue to support, the COM-Interop interface, we are currently looking for an alternative. Creating .msg or .eml files is not an option, as these cannot be edited or sent using "New Outlook".
Would anyone be able to advise a method for programmatically creating an email that can be edited and sent through Outlook?
Best regards,
Selim Basyouni
Hello @mixxxel and everyone facing the same problem,
Luckily i found a solution for this issue. Using .Net, you can easily create eml. Files. Adding 'X-Unsent: 1' to the first line will make 'The New Outlook' to open that mail as draft, allowing you to edit and send the Mail.
Best regards
Selim Basyouni
Example C# Code:
// Erstellen einer neuen E-Mail-Nachricht
MailMessage mail = new MailMessage();
mail.From = new MailAddress("sender@example.com");
mail.To.Add("******@example.de");
mail.Subject = "Test";
mail.Body = "Das ist eine Test eMail.";
// Speichern der E-Mail in einer .eml-Datei
string emlFilePath = "mail.eml";
using (var ms = new MemoryStream())
using (var smtpClient = new SmtpClient())
Is it a prerequisite for your question to use an external program?
It seems that the new Outlook also supports resending.
<Japanese>
外部プログラムで対応する事が質問の前提条件でしょうか?
新しいOutlookでは再送信にも対応した様です。