Can't make Email work from page.

E

efanwick

Guest
I am using this basic code

string fromEmail = ((System.Net.Configuration.MailSettingsSectionGroup)(System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath).GetSectionGroup("system.net/mailSettings"))).Smtp.From;
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient();
System.Net.Mail.MailAddress from = new System.Net.Mail.MailAddress(fe.Text, fe.Text);
System.Net.Mail.MailAddress to = new System.Net.Mail.MailAddress(te.Text, te.Text);
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage(from, to);
message.Subject = "Wanted to tell you about Physio+ in Westport";
message.Body = msg.Text;
smtp.Send(message);


My problem is, it wont run at medium security. So either does anyone know how to make this work at medium or do you have different code for sending email.

I will take either.
 
Back
Top