There was a problem loading the comments.

.Net Mail Application Settings

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

Here are the settings that need to go into the web config file of your .NET application:

<system.net>

You may also use these settings in your Form posts when setting up an email system in C# or VB.NET code behind files.

Another way to use .Net mail class:

string ourEmail = ConfigurationManager.AppSettings["OurEmail"].ToString();
MailMessage mail = new MailMessage();
mail.IsBodyHtml = false;
mail.To.Add(new MailAddress(ourEmail));
mail.From = new MailAddress(ourEmail);
mail.Priority = MailPriority.High;
mail.Subject = "Message from mydomain.com";
mail.Body = txtEmail.Text;
SmtpClient smtp = new SmtpClient(ConfigurationManager.AppSettings["SMTPServer"].ToString());

smtp.UseDefaultCredentials = false;
smtp.Credentials = new System.Net.NetworkCredential(ourEmail, ConfigurationManager.AppSettings["OurEmailPass"].ToString());

smtp.Send(mail);
lblConfirm.Text = "Message sent";
btnSubmit.Enabled = false;


Web Config Settings:






Share via
Did you find this article useful?  

Related Articles

© Softsys Hosting