Aug 10, 2011

How to use Send Email Concepts in application

The MailMessage and SMTP are classes defined in the .NET Framework Class Library's System.Web.Mail namespace. It is due to a security change made to just before it shipped, you need to set SMTPMail's, SMTPServer property to localhost even though localhost is the default. In addition, you must use the IIS configuration applet to enable localhost to relay message through the local SMTP Service.

        MailMessage message = new MailMessage ();
        message.From = <>;
        message.To = <>;
        message.Subject = "Welcome to Example";
        message.Body = "Free Subscribe to the Example";
        SmtpMail.SmtpServer = "localhost";
        SmtpMail.Send (message);

No comments:

Post a Comment