In one of our applications, the user clicks the generate button and creates and opens email in Outlook. All they need to do is click the submit button. Features below.
public static void generateEmail(string emailTo, string ccTo, string subject, string body, bool bcc) { Outlook.Application objOutlook = new Outlook.Application(); Outlook.MailItem mailItem = (Outlook.MailItem)(objOutlook.CreateItem(OlItemType.olMailItem)); if (!(bcc)) { mailItem.To = emailTo; } else { mailItem.BCC = emailTo; } mailItem.CC = ccTo; mailItem.Subject = subject; mailItem.Body = body; mailItem.BodyFormat = OlBodyFormat.olFormatPlain; mailItem.Display(mailItem); }
As you can see, it displays an e-mail message in clear text at the moment, because it must be friendly to the blackberry. You can easily change the HTML or richtext format if you want some formatting options. To use HTML mailItem.HTMLBody
Hope this helps.
EDIT:
I should note that this is used in a C # application and that it refers to Microsoft.Office.Core and using Outlook in the email class the function is in.
source share