Monday 13 April, 2009

Sending Mail

First you add namespace "System.net.mail"

MailMessage objmail = new MailMessage("from mail address", "to mail address", "mail subject", mail message);
SmtpClient Objsmtpclient = new SmtpClient();
Objsmtpclient.Host = "write here your smtp ip (your smtp server ip)";
Objsmtpclient.Send(objmail);

1 comment:

  1. Where is the sending email address and receiving email address ?
    Where the email will go ?

    ReplyDelete