Hello everybody!
When I try to send an e-mail, the following error is displayed:
Request for the permission of type 'System.Net.Mail.SmtpPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed
My code is:
What could be the problem?
When I try to send an e-mail, the following error is displayed:
Request for the permission of type 'System.Net.Mail.SmtpPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed
My code is:
Code:
SmtpClient SmtpClient = new SmtpClient("mail.itesa.com.py", 587);
System.Net.Mail.MailMessage Mail = new System.Net.Mail.MailMessage("user1@domain.com", "user2@domail.com");
Mail.Body = Body;
Mail.IsBodyHtml = true;
Mail.Priority = MailPriority.High;
Mail.Subject = "New message of " + FullName;
SmtpClient.UseDefaultCredentials = false;
SmtpClient.Credentials = new System.Net.NetworkCredential("UserName", "Password");
SmtpClient.EnableSsl = false;
SmtpClient.Send(Mail);
What could be the problem?