Skip to content

Instantly share code, notes, and snippets.

@klpatil
Created July 8, 2020 16:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save klpatil/5f3a110f58e75f8df3a82c12927055aa to your computer and use it in GitHub Desktop.
Save klpatil/5f3a110f58e75f8df3a82c12927055aa to your computer and use it in GitHub Desktop.
Sending email using SendGrid with Sitecore
<?xml version="1.0"?>
<configuration xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<settings>
<setting name="MailServer" set:value="#{SendGrid.SMTP.server}" />
<setting name="MailServerUserName" set:value="#{SendGrid.SMTP.username}" />
<setting name="MailServerPassword" set:value="#{SendGrid.SMTP.password}"/>
<setting name="MailServerPort" set:value="#{SendGrid.SMTP.port}" />
</settings>
</sitecore>
</configuration>
<system.net xdt:Transform="InsertIfMissing">
<mailSettings xdt:Transform="InsertIfMissing">
<smtp xdt:Transform="InsertIfMissing">
<network host="__SendGrid.SMTP.server__" password="__SendGrid.SMTP.password__" userName="__SendGrid.SMTP.username__" port="__SendGrid.SMTP.port__" />
</smtp>
</mailSettings>
</system.net>
@bewards
Copy link

bewards commented Feb 18, 2021

what is this syntax set:value="#{SendGrid.SMTP.server}" and does it relate to host="__SendGrid.SMTP.server__", or are these just placeholders?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment