Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have added Global.asax file to my website. I need to send email through that. Everything is fine but I do not know how to Import System.Net.Mail to the file.

Please advise.
Thanks
Posted

Just add

using System.Net.Mail;
in your code file of your Global.asax.

In case if dont have a cs file , use a script tag for adding the references

XML
<script runat="server">
using System.Net.Mail; 
</script>


If you want to add global.asax file can have a reference here .
http://www.aspdotnet-suresh.com/2011/05/how-to-add-globalasaxcs-file-in-aspnet.html[^]
 
Share this answer
 
Answer is
<%@ Import Namespace="System.Net.Mail" %>
 
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