0

I have a very simple Umbraco site. I can send "forgot password"-email when running the site from localhost, but when I deploy it to my azure app service I get the error message

"Request password reset failed for email forgetful_backoffice_user@gmail.com"

this is from my web.config and umbracoSettings.config.

Im also interested in how to diagnose this problem. I have looked in \app_data\logs, but I cant see any error message that is related to sending mail. In the Umbraco-db, the table UmbracoLog has merely 30 rows, non-related.

<mailSettings>
  <smtp deliveryMethod="Network" from="xxxxxx@gmail.com">
    <network defaultCredentials="false" host="smtp.gmail.com" userName="xxxxxx@gmail.com" password="yyyyyyyyy" port="587" enableSsl="true" />
  </smtp>
</mailSettings>


 <notifications>
  <!-- the email that should be used as from mail when umbraco sends a notification -->
  <email>xxxxxx@gmail.com</email>
</notifications>

EDIT: I have activated "less secure apps" on my gmail account and also followed this link from my gmail account. No difference Umbraco health check says ok and that it has sent a mail to the email-address, but none was received.

EDIT2: I got it working with an office365-account (instead of gmail). But Id still like to know why it doesnt work and how to diagnose similar problems

Cowborg
  • 2,645
  • 3
  • 34
  • 51
  • It could be that Gmail is flagging the location. Read this answer, and double-check that Google isn't stopping Azure from being able to use the Gmail SMTP host. https://stackoverflow.com/a/12150975/3609 – Mike B Mar 20 '18 at 14:51
  • Thanks for your reply :). I am already using ssl and username/pwd should be ok, since I use same as from localhost. I also tried the Uncaptcha-link, while logged in as the mailaccount. I have also activated "login from less secure apps" on my gmail-account, but no difference. :( – Cowborg Mar 20 '18 at 15:03
  • ...but your'e right, its has to do with google, I tested with an office365-account and that worked both locally and in azure.Updating post – Cowborg Mar 20 '18 at 15:43
  • At least you've been able to narrow it down! I've had countless issues with Gmail in the past, so for Azure I tend to use SendGrid instead and keep it all largely within Azure. There are dozens of Q's on here about getting Gmail to work on ASP.NET MVC, so I'd look through there if you're looking for a resolution with Gmail. – Mike B Mar 21 '18 at 15:39
  • Ok, maybe I should drop gmail then. But id did in fact try to use Sendgrid as well, by signing up on sendgrid.com, I got a host, portnr, username (which was "apikey") and a ginormous password. But when trying to use that, I got the same generic error message when trying to send "forgot password"-email, even in dev/localhost... – Cowborg Mar 22 '18 at 08:09

0 Answers0