I’m having trouble with my email functionality when deploying to AppHarbor. The emails work perfectly on my local machine but fail once deployed.
string mailDomain = ConfigurationManager.AppSettings["MG_DOMAIN"];
string secretKey = ConfigurationManager.AppSettings["MG_SECRET_KEY"];
MailgunService emailService = new MailgunService(mailDomain, secretKey);
emailService.SendEmail(new System.Net.Mail.MailMessage("support@" + mailDomain, "[email protected]")
{
Subject = "Welcome to our service",
Body = "Thank you for signing up with us."
});
My configuration looks like this:
<add key="MG_SECRET_KEY" value="key-*********************" />
<add key="MG_DOMAIN" value="myapp.mailgun.org" />
The error I get on AppHarbor is System.Exception: Domain not found: smtp.mailgun.org
I think there might be additional configuration settings I need to use but I can’t figure out how to properly integrate them with the Mailgun client. Has anyone encountered this issue before?