locked
Configuring web.config to send emails RRS feed

  • Question

  • User494690411 posted
    Hi, I'm about to deploy my first website to Azure:
    There is a contact form in my website with 4 text boxes (email, name, subject and body) and send button. I use this configuration to send emails:
    <system.net>
    <mailSettings>
    <smtp deliveryMethod="Network" from="Mohamed &lt;name@outlook.com&gt;">
    <network host="Smtp.live.com" port="587" enableSsl="true" userName="name@outlook.com" password="mypassword"/>
    </smtp>
    </mailSettings>
    </system.net>

    I use these settings for the IIS server, obviously it's not working with production server.
    Please tell me what changes should I do to enable this function?
    Thursday, February 25, 2016 5:11 PM

Answers

All replies

  • User-121157572 posted

    Please read below article to know how to send email from Azure.

    https://azure.microsoft.com/en-us/documentation/articles/sendgrid-dotnet-how-to-send-email/

    Thursday, February 25, 2016 5:42 PM
  • User753101303 posted

    Hi,

    Though using SendGrid can be a good idea, you are sure it doesn't work? I'm fairly sure this is one of the first thing I tried and it was working fine (I had to allow gmail to accept the connection from an unusual location, maybe is this a similar error with Outlook.com?). Would have to give this another try...

    Edit: According to several posts it seems port 587 is not blocked (unlike port 25). I believe it might not work if Outlook.com is not allowed to accept a connection from an unusual location.

    Edit;: tried with a Web App and smtp-mail.outlook.com and same behavior that is it fails but if you look at your mailbox you see this is because it is considered an unusual location. If you then confirm you want to allow this location, it then works without any problem...

    Thursday, February 25, 2016 6:15 PM
  • User-646145796 posted

    Hi,

    Please have a look at this thread: http://stackoverflow.com/questions/25224768/cannot-send-email-through-hotmail-live-com-outlook-com. The solution was to browse to the account settings, locate the SMTP request in its recent activity, and select "This was me".

    Best Regards,

    Jambor

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, February 26, 2016 5:57 AM