Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Postal on Azure with Sendgrid #130

Open
Andreas75 opened this issue Nov 24, 2015 · 1 comment
Open

Using Postal on Azure with Sendgrid #130

Andreas75 opened this issue Nov 24, 2015 · 1 comment

Comments

@Andreas75
Copy link

Hi, i'm trying to use Postal on a web app hosted in Azure. But get this error:
System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed.

This is the code i'm using:

dynamic email = new Email("Test");
email.To = "[email protected]";
System.Net.NetworkCredential credentials = new System.Net.NetworkCredential("azure_d3e************************[email protected]", "7N**********5C");
SmtpClient smtpClient = new SmtpClient("smtp.sendgrid.net", Convert.ToInt32(587));
smtpClient.Credentials = credentials;
email.Send();

My Test view:

To: [email protected]
From: [email protected]
Subject: Important Message

Hello,
This is a tests!!

My web.config smtp settings:

@tbasallo
Copy link

tbasallo commented Dec 9, 2015

I use Postal with SendGrid in Azure (Web Apps). The only thing I changed was in the web.config.

 <mailSettings>
  <smtp from="[email protected]" deliveryMethod="Network">
    <specifiedPickupDirectory pickupDirectoryLocation="c:\email" />
    <network host="smtp.sendgrid.net" port="587" userName="{username}" password="{password}" />
  </smtp>
</mailSettings>

And then I just
dynamic e = new Email("view");
e.Send();

However, in your code, you have an SMTP client you instantiated, but you didn't do anything with it. Not sure if it was a copy & paste error. But, if there's nothing in your config, that would never work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants