Open Email Dialog from ASP.NET webpage?

  • Thread starter Thread starter jim
  • Start date Start date
J

jim

I'm looking for a way to open up a compose new e-mail message dialog
(such as from Outlook, Eudora, etc) using C# code behind.

C# code that will do the same thing as:

"mailto:[email protected]"


Any suggestions? Or do I have to write Javascript to make this
happen?



Please reply.



Thanks in advance!!
 
If you are sending mail using the client's mail system, and you want the user's email dialog to pop up, and the user fills in the mail content, then use the mailto protocol as you described. You can either use javascript to create a hyperlink, or insert the protocol in the destination URL of a server or HTML control.

If you want to control the mail content programatically, then you can send it from the server using SmtpMail.Send(), which is in System.Web.Mail.

Jon
 
If you open a new email in the code behind, this is going to happen on the
server where nobody is looking. This is done on the client. Is there
anything wrong with using a linkbutton that has its target set to
mailto:[email protected]? Are you looking for additional functionality
that a hyperlink doesn't provide?
 
Back
Top