email settings for gmail doesnt work

I’m trying to get the email settings for gmail to work. I’ve tried a bunch of different settings, but nothing seems to work properly.

These are the settings I’ve tried. (multiple times)

Works? smtp server port SSL enabled? Note:
doesn’t work smtp.gmail.com 587 yes
doesn’t work smtp.gmail.com 587 no
doesn’t work smtp.gmail.com 465 yes error 500
doesn’t work smtp.gmail.com 465 no error 500
doesn’t work smtp.gmail.com 25 yes error 500
doesn’t work smtp.gmail.com 25 no error 500

IS there a setting which I’m missing? I’m very lost at the moment.

According to https://support.google.com/mail/answer/7126229?hl=en, it should be:

smtp.gmail.com
Requires SSL: Yes
Requires TLS: Yes (if available)
Requires Authentication: Yes
Port for SSL: 465
Port for TLS/STARTTLS: 587

Make sure:

Since you have internal server error 500, you should enable debug to see more info. See the follows under Tools → Advanced Settings in the help file:

  • Debug
  • Set enviroment to ‘Development’ in web.config
  • Enable ASP.NET Core stdout log

Also make sure your server does not have firewall or other software which may prevent the web application to send email through the port.