I am trying to configure the Sendgrid credentials for a the SMTP.
Before the configuration was done with an API Key. It seems that now the configuration is different. The host name has changed from smtp.sendgrid.com to smtp.episerver.net. It makes me wonder if Episerver is using the same Sendgrid instance for all their customers.
Nevertheless, I can't make it work with the configuration I got from DCX services. I have tried with SSL and without it, and with different ports, but wasn't able to make it work.
I was able to make it work with a personal Sendgrid account, using the old API Key method. But couldn't with the new configuration.
This is the help page for configuring Sendgrid:https://world.episerver.com/digital-experience-cloud-service/development-considerations/configuring-the-email-server/
This is the configuration I have in place
<smtp from="firstname.lastname@example.org" deliveryMethod="network"> <specifiedPickupDirectory pickupDirectoryLocation="" /> <network enableSsl="false" host="smtp.episerver.net" port="587" userName="dxc_XXXX" password="XXXXXXXXX"/> </smtp>
<smtp from="email@example.com" deliveryMethod="network"> <specifiedPickupDirectory pickupDirectoryLocation="" /> <network enableSsl="false"
host="smtp.episerver.net" port="587" userName="dxc_XXXX" password="XXXXXXXXX"/> </smtp>
This is the error I got
2019-08-25T01:21:14 PID Error lambda_method : Failure sending mail.
System.Net.Mail.SmtpException: Failure sending mail. ---> System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed.at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte buffer, Int32 offset, Int32 read, Boolean readLine)at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine)at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)at System.Net.Mail.CheckCommand.Send(SmtpConnection conn, String& response)at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte command, MailAddress from, Boolean allowUnicode)at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, Boolean allowUnicode, SmtpFailedRecipientException& exception)at System.Net.Mail.SmtpClient.Send(MailMessage message)---
you have `...episerver.net` as host. is that correct?
All our Episerver DXC sites use Sendgrid, and our typical config (transform) looks like this.
Episerver Support has previously told us the Host can be either smtp.episerver.net or smtp.sendgrid.net but we always use the former.
I'd be double-checking the Username with Episerver Support, I've seen some inconsistent naming conventions for Usernames, some older ones have been DXC_ prefixed while the most recent Usernames have been 4 characters all Uppercase with no prefix.
We don't typically use deliveryMethod="network" but please note in the Official documentation Network is upper-case N, I'm not sure if that is case-sensitive. https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/network/smtp-element-network-settings
Thanks Valdis, it was a typo, I have just updated my post. ".net" is the right one.
Thanks Darren, I have reached Epi Support to double-check the values and will try with the upper-case N.
Update on this. The initial credentials I got were wrong.
Just double checked with Episerver Support and , ss you said Darren, the user has now only 4 letters, and with the above configuration works.