I believe the Umbraco smtp settings are specific to Umbraco i.e. Forms and password resets.
If you're using the native .NET way to send emails yourself you have to also configure your native smtp settings, as you've done, but with the host information as well.
The SMTP host was not specified.
I'm getting the 500 error:
But, I've specified the SMTP in appsettings.json
To double down I also added it to web.config:
What am I missing?
Exactly what is in the error :-)
Smtp requires a "Host"
@AmbertvanUnen
Thanks for your response! The full error:
I got the same error after adding
"Host": "localhost",
to appsettings.json.Do you get this error on startup or when sending a form? Do you have some custom implementation?
@AmbertvanUnen the error only fires when attempting to send a MailMessage
Hi!
I believe the Umbraco smtp settings are specific to Umbraco i.e. Forms and password resets.
If you're using the native .NET way to send emails yourself you have to also configure your native smtp settings, as you've done, but with the host information as well.
Have a look at https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/network/smtp-element-network-settings.
You can also set the configuration on the
SmtpClient
itself, if you want to read your Umbraco config settings.Thanks @JohanRunsten
That makes sense what you said about the appsettings.json smtp configuration applying to Umbraco mail delivery. I hadn't thought of that.
As you see in my original post, I also added the smtp configuration to the web.config file in my root.
Hi!
But you didn't add the host setting right? Check out the example configuration at the bottom of this page: https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/network/smtp-element-network-settings
So I have this in the web.config in the root of my Umbraco 9 site.
And I get the The SMTP host was not specified error.
I have the same configuration in my Umbraco 8 site and it sends without error.
I hardcoded the pickup directory in my Umbraco 9 site and now it sends without error.
It's as if .Net Core doesn't honor the SMTP web.config configuration.
Here's a related thread I found on the subject: https://github.com/umbraco/Umbraco-CMS/pull/11548
is working on a reply...