Request for the permission of type 'System.Net.Mail.SmtpPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
protected void BtnSend_Click(object sender, EventArgs e) { try { MailMessage MM = new MailMessage(TxtFAddress.Text, TxtToAddress.Text, TxtSubject.Text, TxtMatter.Text); MM.IsBodyHtml = false; NetworkCredential Nc = new NetworkCredential(TxtFAddress.Text, "kattalavan0303"); SmtpClient Sc = new SmtpClient("smtp.gmail.com", 587); Sc.UseDefaultCredentials = false; Sc.Credentials = Nc; Sc.EnableSsl = true; Sc.Send(MM); lblDisplay.Text = "Mail Delivered sucessfully"; } catch (Exception ex) { lblDisplay.Text = ex.Message; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)