BFry
BFry

Reputation: 915

To open outlook new email window with content already filled

How can I implement email functionality, where:

When I click on an asp button, a new email window opens with all the content already added from code behind( including To address, From address, Subject and Body).

But the email should not be sent automatically. It requires user to click send button.

The purpose is, admin can modify the email content before sending to users.

Has anyone worked on similar functionality and can help or give me idea on how to implement it ?

Upvotes: 1

Views: 6536

Answers (2)

TheTechGuy
TheTechGuy

Reputation: 17384

I think you do not need ASP.NET for this. All you need is mailto with the right parameters.

Example: 

<a href="mailto:[email protected]?Subject=Hello%20again&body=This%20is%20body">
Send Mail</a>

This will send email to [email protected] with subject "Hello" and body "This is body". You can also use CC parameter to add CC emails.

More info on this link

A related question that may help How do I properly encode a mailto link?

Upvotes: 2

Saddam Abu Ghaida
Saddam Abu Ghaida

Reputation: 6749

Outlook.Application outlookApp    = new Outlook.Application ();
Outlook._MailItem mailItem = (Outlook._MailItem)outlookApp.CreateItem ( Outlook.OlItemType.olMailItem );
mailItem.To  = address;
// body, bcc etc...
mailItem.Display ( true );

Upvotes: 5

Related Questions