How do I configure a local SMTP server?

Install the SMTP virtual server that is part of IIS. You will need your Windows installation CD. Use Add or Remove Programs in the Windows Control Panel to launch Add/Remove Windows Components. Select Internet Information Services (IIS) and then click Details. Check SMTP Service and then click OK. The installation process will prompt you for your Windows CD and will install the SMTP virtual server. After installing the SMTP server (also reboot), configure it by following these steps: In the Control Panel, choose Administrative Tools, and then choose Internet Information Services. Open the node for your computer, right-click the Default SMTP Virtual Server node and choose Properties. In the Access tab, click Connection. Select Only the list below, click Add and add the IP 127.0.0.1. This restricts connections to just the local computer, i.e., localhost. Close the Connection dialog box. Click Relay and repeat Step 5 to allow only localhost to relay through this server. In your firewall or router (or both), close incoming port 25. This is an important security measure that will prevent spammers from finding your SMTP server and using it to relay spam.

What is the namespace used for sending mails

Use System.Web.Mail The System.Web.Mail namespace contains classes that enable you to construct and send messages using the CDOSYS (Collaboration Data Objects for Windows 2000) message component. The mail message is delivered either through the SMTP mail service built into Microsoft Windows 2000 or through an arbitrary SMTP server. The classes in this namespace can be used from ASP.NET or from any managed application. For more details refer System.Web.Mail Namespace

How do I email a website exception

VB.NET Protected Sub Application_Error(sender As [Object], e As EventArgs) Dim ex As Exception = Server.GetLastError() Dim mail As New MailMessage() mail.To = ‘[email protected]’ mail.From = ‘[email protected]’ mail.Subject = ex.Message.ToString() mail.Body = ex.ToString() mail.BodyFormat = MailFormat.Html SmtpMail.SmtpServer = ‘localhost’ SmtpMail.Send(mail) End Sub ’Application_Error C# protected void Application_Error(Object sender, EventArgs e) { Exception ex = Server.GetLastError (); MailMessage mail = new MailMessage(); mail.To = ‘[email protected]’; mail.From = ‘[email protected]’; mail.Subject = ex.Message.ToString (); mail.Body =ex.ToString (); mail.BodyFormat = MailFormat.Html; SmtpMail.SmtpServer = ‘localhost’; SmtpMail.Send( mail ); }

How do I send non US-ASCII mails

VB.NET mail.BodyEncoding = System.Text.Encoding.GetEncoding( ‘ISO-2022-JP’ ) C# mail.BodyEncoding = System.Text.Encoding.GetEncoding( ‘ISO-2022-JP’ );