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 get a database timeout expired error on my ASP.NET application. What can I do?

I get the following error when my ASP.NET application connects to the MS SQL server:...

In one of the applications I want to host, there must be a write privilage to ASPNET account so that it will be able to create folders, so is that possible ?

Yes, that is possible. In fact you can set the read and write permission yourself. Our control...

I receive an error when trying to access an ASP.NET page within a subweb. What do I do?

The ASPNet (user as which ASP.NET runs) user permission does not inherit into the subweb....

How do I setup custom error for my application? has its own built-in error handling. To set up custom error handling for your

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...