Click here to Skip to main content
15,892,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to open outlook on gridview email click
-----------------------

Hi Friends,

I want to open outlook if the email click in asp.net gridview

I have a column name Email in gridview. when it clicks, it should open outlook and this clicked email should be displayed in outlook TO Textbox.

Please help.

Thanks.
Posted

For that you have to set a href='mailto:[emailID]' for the column Email. Remember you must have outlook installed on your system.
Your Template column should be like
ASP.NET
<asp:templatefield xmlns:asp="#unknown">
   <itemtemplate>
       <a href="<%# "mailto:"+Eval("Name").ToString() %>">Mail</a>
   </itemtemplate>
</asp:templatefield>
 
Share this answer
 
You need set OUTLOOK as your default email app and then in your application(gridview) make sure that your email link are in following format. You just need to provide the value in correct format to the href attribute.

HTML
<a href="mailto:receipient@domain.com">receipient@domain.com</a>


Hope, it helps :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900