Reputation: 22264
I'm trying to send a simple email to my users using AppHarbor and the MailGun addon. I also installed the MailGun NuGet package to send email easier from my C# code.
I get the following error:
System.InvalidOperationException: Domain not found
Here is the code I'm running:
/* Send welcome email. */
var client = new MailgunClient("foo.apphb.com", "key-1-jpn-190fj8102i3nf12i3fno213f");
client.SendMail(new System.Net.Mail.MailMessage("[email protected]", "[email protected]")
{
Subject = "Hello from mailgun",
Body = "this is a test message from mailgun."
});
Any ideas why this error message is popping up?
Upvotes: 1
Views: 2359
Reputation: 154
MailGun provides a Domain Name when you integrate with you application. Use this domain name here. It should be something similar to "abcd.mailgun.org".
Upvotes: 2
Reputation: 19279
You probably shouldn't use foo.apphb.com
when configuring the MailGun client. I'm guessing, but you should probably use the MAILGUN_SMTP_SERVER
configuration variable that's injected when your app is deployed on AppHarbor.
Upvotes: 2