ASP.NET Identity account management - Register & Login

MECressey's Avatar

MECressey

24 Jun, 2017 12:20 PM

Hi,

My ASP.NET MVC app uses the re-made Identity account management pages and database. During Register, I enabled an SMTP email confirmation to confirm the user's registration. I had to add <mailSettings> to my Web.config and enable code in the AccountCounter Register function (UserManager.SendEmailAsync). This works on my local machine but doesn't appear to work on AppHarbor. Is there anything that needs to be done to make SendEmailAsync to work?

Thanks.

Mike

  1. Support Staff 1 Posted by rune on 29 Jun, 2017 04:26 AM

    rune's Avatar

    Hi Mike,

    How are the mailSettings currently configured? Are you using an external service to send emails, or do you rely on your own machine to handle that part (e.g. with a development email server)? If it's the latter you'll need to configure your SMTP settings to use a service available to your AppHarbor app as we don't support sending emails from our servers.

    You may want to try and just install the Mailgun add-on as that will replace the configuration on deployment -- take a look at this KB article for more information on that and a few other services you may want to try!

    Best,
    Rune

  2. 2 Posted by MECressey on 29 Jun, 2017 12:24 PM

    MECressey's Avatar

    Hi Rune,

    Thanks for replying. I actually got the email to send using the Gmail SMTP server - smtp.gmail.com. The issue I was having had to do with authenticating with the gmail.

    But the link that it generated to confirm registration did not work. When it redirected back to appharbor, it just hung. I don't think I even got an error message.
     Unfortunately, I don't have the link anymore (but maybe I can get it). Of course, it worked when I tested it locally.

    The register/login/confirm/reset is all out-of-the-box code that is generated for you by Visual Studio when you use ASP.NET Identity configuration.

    Mike

  3. Support Staff 3 Posted by rune on 29 Jun, 2017 11:48 PM

    rune's Avatar

    Hi Mike,

    Ok yeah it'd be really helpful if you could get or generate a new link so I can take a look -- I suspect it may be an issue with the link being generated with the backend worker's port, or perhaps with the wrong hostname. If that's the case I'd recommend you take a look at this KB article for a couple of tips and tricks to generate absolute URLs without port numbers.

    If that doesn't help or you get a new link that just "hangs" then please feel free to reach out!

    Best,
    Rune

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac