John
John

Reputation: 10969

Embedding HTML into an email via MAPI32

I have a program in C# that has a call:

myEmail.SendMailPopup("Hi", "This is my email body");

which uses MAPI32.DLL to open an Outlook email with the subject of Hi and a body of This is my email body.

However, when I send it HTML, such as

myEmail.SendMailPopup("Hi", "<html><body><b>Bold text</b></body></html>");

the message body contains what it literally in the quotation marks.

Is there a way to parse this HTML to show "Bold text" in bold?

Thanks.

Upvotes: 2

Views: 1995

Answers (2)

SwDevMan81
SwDevMan81

Reputation: 50028

I'm not sure that is possible. You might want to check out the Microsoft.Office.Interop.Outlook option. Just found a good example.

Upvotes: 2

jcolebrand
jcolebrand

Reputation: 16035

Since SendMailPopup is not a MAPI32.dll method that I'm aware of, is there anyway to share the internals of what SendMailPopup does? Does it by chance encode the message in anyway?

Doesn't MAPI32.DLL assume

[DllImport("MAPI32.DLL")]
static extern int MAPISendMail(IntPtr sess, IntPtr hwnd, MapiMessage message, int flg, int rsv);

Upvotes: 1

Related Questions