+91 88 00 563434 sales@webhostingpeople.net

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

The next scripts use SMTP Authentication to ship mail out of your script –

<% @Web page Language=”C#” %>
<% @Import Namespace=”System.Internet.Mail” %>
<% MailMessage mail = new MailMessage(); mail.To = “FRIEND@FRIENDSDOMAIN.COM”; mail.From = “YOU@YOURDOMAIN.COM”; mail.Topic = “this can be a check electronic mail.”; mail.Physique = “Some textual content goes right here”; mail.Fields.Add(“http://schemas.microsoft.com/cdo/configuration/smtpauthenticate”, “1”); //primary authentication mail.Fields.Add(“http://schemas.microsoft.com/cdo/configuration/sendusername”, “YOU@YOURDOMAIN.COM”); //set your username right here mail.Fields.Add(“http://schemas.microsoft.com/cdo/configuration/sendpassword”, “PASSWORD”); //set your password right here SmtpMail.SmtpServer = “localhost”; //your actual server goes right here SmtpMail.Ship( mail ); %>

Read More