locked
Sending email using smtp in azure RRS feed

  • Question

  • User-893002196 posted

    Hi All,

    I got this error when trying to send email using smtp. I have added allow ip address at Azure Management Portal:-

    message.Sender = new MailAddress(from, "Software Allocation AutoMailer");
    message.Body = msgBody;  
    System.Net.Mail.
    SmtpClient smtp = new System.Net.Mail.SmtpClient("xxx.xx.0.100", 25);

    Error I got:-

    An attempt was made to access a socket in a way forbidden by its access permissions xxx.xx.0.100:25             
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.            

    Exception Details: System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions xxx.xx.0.100:25

    Anyone can let me know what is wrong?

    Thank you.

    Regards,

    Micheale

    Monday, November 16, 2015 8:59 AM

Answers

  • User1100692814 posted

    Hi

    Have a look at: Send Email with SendGrid

    I used this article to help me and out web app uses it for around 10K emails a month.

    Hope this helps.

    David

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 16, 2015 9:13 AM