-1

I need to send email from my code using the below code snippet. It is working fine in my code, but when I deploy the code in microsoft azure I am getting an error as follows.Kindly help me to rectify the issue.

 MailMessage mail = new MailMessage();
            mail.From = new MailAddress(FromAddress);
            mail.To.Add(email);
            mail.Subject = subject;
            mail.Body = body;
            mail.IsBodyHtml = true;
            SmtpClient SmtpServer = new SmtpClient("smtp.sendgrid.net");
            SmtpServer.Port = 587;
            SmtpServer.DeliveryMethod = SmtpDeliveryMethod.Network;
            NetworkCredential myCreds = new NetworkCredential(EmailUsername, EmailPassword);
            SmtpServer.EnableSsl = true;
            SmtpServer.UseDefaultCredentials = false;
            SmtpServer.Credentials = myCreds;
            SmtpServer.Send(mail);

Error as Follows

enter image description here

SJoy
  • 142
  • 10

1 Answers1

0

Finally I found a Solution, I have written some code for getting OS version and Browser version. That was creating issue.

SJoy
  • 142
  • 10