System.Web.Mail Sample C# and VB .NET Script

The following scripts use SMTP Authentication to send mail from your script – C#: <% @Page Language=”C#” %> <% @Import Namespace=”System.Web.Mail” %> <% MailMessage mail = new MailMessage(); mail.To = “FRIEND@FRIENDSDOMAIN.COM”; mail.From = “YOU@YOURDOMAIN.COM”; mail.Subject = “this is a test email.”; mail.Body = “Some text goes here”; mail.Fields.Add(“http://schemas.microsoft.com/cdo/configuration/smtpauthenticate”, “1”); //basic authentication mail.Fields.Add(“http://schemas.microsoft.com/cdo/configuration/sendusername”, “YOU@YOURDOMAIN.COM”); //set your […]

Read More »