Sending emails

Hi guys,

I thought of publishing this article abt sending emails in ASP.net. It might help somebody.

If you are using ASP.net 2.0 you can this method

System.Net.Mail.MailMessage mailMessage = new System.Net.Mail.MailMessage(“fromaddress”, “toAddress”);
mailMessage.Body = “body”;
mailMessage.Subject = “subject”;

System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient(“mailhost”);
smtp.Send(mailMessage);
You need to configure SMTP IN your IIS.

Advertisements

One thought on “Sending emails

  1. eranda, without setup an SMTP server, we can send e-mails know?
    As I know for that we have to give a SMTP IP address. Do you know any IP address, that support requests from out side(means which we can use).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s