How did I send email from ?

You have to use System.Web.Mail namespace
Below is the code snippets :

using System.Web.Mail;

MailMessage myemail = new MailMessage();
myemail.From = ""
myemail.To =;
myemail.Fields[""] = 1;
myemail.Fields[""] = "myusername";
myemail.Fields[""] = "mypass";
            System.Web.Mail.SmtpMail.SmtpServer= ""
            Response.Write("send successfully");
catch(Exception Error)

Replace with your domain name.
Replace user name with your mail username (full address)
Replace password with your email password.

Remember, you have to authenticate yourself before you can send email from our server or else the mail will not be delivered.

Was this answer helpful?

 Print this Article

Also Read

I am using ASP.NET and Internet Explorer Web Controls and it does not work when I open the page. What is wrong?

For Internet Explorer Web Controls to work properly you need to have the required HTML...

I get an error 'A potentially dangerous Request.Form value was detected from the client ' when I hit submit on my ASP.NET Webform. What can I do?

This error is caused by a newly introduced feature of .NET Framework 1.1, called "Request...

I get a configuration error when I execute my application in a subdirectory. How do I resolve this?

This error may occur if the application is being run out of a subfolder and the subfolder is not...

How do I connect my application to MySQL database?

In general, 2 different methods can be used to connect an application to MySQL database....

How do I get my application to display non-English language