Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Populate outlook new email with HTML content in winform

124 views
Skip to first unread message

mobilebilly

unread,
Jun 20, 2007, 7:11:01 AM6/20/07
to
Is there anyway to popup an outlook new email dialog with HTML content
pre-populated from a winform application?
I have tried using the mailto shell command and found that HTML content is
not supported.

Any help will be highly appreciated. Thanks.

t-qi...@prcvap.microsoft.com

unread,
Jun 20, 2007, 11:39:15 PM6/20/07
to
Hi mobilebilly:

By your description, I think your aim is to send a HTML format mail in winform appliction using Outlook, isn't it? If there is any midunderstanding please feel free to tell us.

You can refer to the KB article:
[How to use the Microsoft Outlook Object Library to send an HTML formatted message by using Visual C#]
http://support.microsoft.com/kb/310262/en-us


Please stay in touch and let me know how about the problem. I am standing by
for your response.

Regards,

Qifeng Ji
Microsoft Online Support
Microsoft Global Technical Support Center
Get Secure! - www.microsoft.com/security
=====================================================
When responding to posts, please "(Reply to Group)" via your newsreader so that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

mobilebilly

unread,
Jun 21, 2007, 12:27:01 AM6/21/07
to
Hi,

Thanks for answering, however that is not exactly what I want to know.

I would like to have something like a "New email" button on a winform
application.
When the user click on the button, a new email dialog will be displayed. The
email dialog will be populated with some html content which contains data
from the winform application. The user can modify the email message before
clicking on the send button.

On the other hand, since some users may not have outlook installed (they may
have outlook express, thunderbird, etc), is there any more generic way to
communicate with the client default email client application and populate the
new email dialog with html content?

Regards,
Billy

t-qi...@prcvap.microsoft.com

unread,
Jun 21, 2007, 8:29:32 PM6/21/07
to
Hi mobilebilly:

Thank you for you explaining again.

First, if the user having different default mail client, you can open their mail client by using the following c# code:

System.Diagnostics.Process.Start("mailto:myfi...@hotmail.com");

but the problem is that you cannot display the HTML content in every mail client in the third parties' mail application, such as thunderbird.

Therefore, the workround is using the Outlook mail client and then you aim can be easily realized by using namespace Microsoft.Office.Interop;

Microsoft.Office.Interop.Outlook.MailItem oOMail;

oOMail = (Microsoft.Office.Interop.Outlook.MailItem)oOApp.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olMailItem);
oOMail.HTMLBody="<hr/>";
oOMail.Display(System.Type.Missing);

Please refer to the [Outlook from the Managed World] for more information,
http://blogs.msdn.com/coding4fun/archive/2006/10/31/909239.aspx



Please stay in touch and let me know how about the problem. I am standing by
for your response.

Regards,

Qifeng Ji
Microsoft Online Support
Microsoft Global Technical Support Center
Get Secure! - www.microsoft.com/security
=====================================================
When responding to posts, please "(Reply to Group)" via your newsreader so that others may learn and benefit from your issue.
=====================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

t-qi...@prcvap.microsoft.com

unread,
Jun 26, 2007, 8:51:31 PM6/26/07
to
Hello:

Has the problem been resolved now?
If you still have any questions about it, please feel free to ask.
Thanks.

Rays@discussions.microsoft.com Sun Rays

unread,
Aug 9, 2008, 7:39:00 AM8/9/08
to
Hi,
I want to send mail from default mail client in HTML format with inline image.

Want to open DEFAULT MAIL CLIENT.

in VB6.

any help ?

0 new messages