Hi,
What are the settings for sending e-mails over Gmail?
It should be:
smtp.gmail.com Requires SSL: Yes Requires TLS: Yes (if available) Requires Authentication: Yes Port for TLS/STARTTLS: 587
I tried also CustomMailKitSmtpBuilder because of STARTTLS: https://forum.aspnetboilerplate.com/viewtopic.php?f=5&t=10543 But without success.
I tried on localhost and Azure.
Thanks, Niko
1 Answer(s)
-
0
I got it working:
smtp.gmail.com SSL OFF 587
AppCoreModule:
Configuration.ReplaceService<IMailKitSmtpBuilder, CustomMailKitSmtpBuilder>(DependencyLifeStyle.Transient);
...
public CustomMailKitSmtpBuilder(ISmtpEmailSenderConfiguration smtpEmailSenderConfiguration, IAbpMailKitConfiguration abpMailKitConfiguration) : base(smtpEmailSenderConfiguration, abpMailKitConfiguration) { }
protected override void ConfigureClient(SmtpClient client) { client.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true; base.ConfigureClient(client); }
Slightly different from aspboilerplate: https://aspnetboilerplate.com/Pages/Documents/Email-Sending