Using a .msg to sedn email

Hi,


Is there a way to send email using an existing .msg file without touching the formatting, image extraction etc such that the mailmessage handles all images, attachments etc.
Please share the code.

Hi Harmeet,

You can load a MSG file from disc using MailMessage API, then modify it’s From and To fields, and send it out. This won’t make any changes to the structure of the message and send it out. Please try the following code at your end and share your feedback with us if you face any issue.

Sample Code:

MailMessage msg = MailMessage.Load(“existing message.msg”, new MsgLoadOptions());

msg.From = "dr38445@gmail.com";

msg.To = "newcustomeronnet@gmail.com";

SmtpClient smtp = GetSmtpClientDr38445(); //some smtp client

smtp.Send(signed);