views:

164

answers:

1

Hi,

I am developing the addin for the outlook 2007 using VSTO. One of the function is to capture the send event, then force convert the email format to HTML and then insert a link to the bottom of the email message content. Following is my code to convert the email content to html format:

mailItem.BodyFormat = OlBodyFormat.olFormatHTML;
string link = generateLink();
mailItem.Body += link;

However, when the email was recevied, it is not appear in the HTML format

What's wrong with the above code for making email as HTML?

Thank ~~ Patrick

+2  A: 

You have to set mailItem.HTMLBody instead of mailItem.Body to use HTML.

Greetings Sander

Sander