I just got an email my account was provisioned, so I tried sending a test from C# code (copy paste of http://wiki.sendgrid.com/doku.php?id=... - replaced from, to, and account information in the credentials)
I got an error, connection attempt failed due to timeout or due to the host not answering: 174.36.80.222:25
What could be the reason?
Help get this topic noticed by sharing it on
Twitter,
Facebook, or email.
Twitter,
Facebook, or email.
-
EMPLOYEE
1that's the wrong IP for sending email through sendgrid. Did you put sendgrid.net for the mail server instead of smtp.sendgrid.net? -
-
Hmm when i retried (just moments ago) it immediately seemed to work. So this can be closed I guess :)
-
-
Hmmm, and again the error appears:
Receive the same error with the same IP address...
The following is a copy paste of my c# (just replaced my password...)
// To
MailMessage mailMsg = new MailMessage();
mailMsg.To.Add("tom.deleu@onimedia.be");
// From
MailAddress mailAddress = new MailAddress("info@hexi.net");
mailMsg.From = mailAddress;
// Subject and Body
mailMsg.Subject = "subject";
mailMsg.Body = "body";
// Init SmtpClient and send
SmtpClient smtpClient = new SmtpClient("smtp.sendgrid.net", Convert.ToInt32(25));
System.Net.NetworkCredential credentials = new System.Net.NetworkCredential("tom.deleu@gmail.com", "*******");
smtpClient.Credentials = credentials;
smtpClient.Send(mailMsg); -
-
I receive the same error when using the sample c# code. Were you able to resolve this?
-
-
Sorry for not getting back any sooner. I always seem to have the same problem.
From my work internet connection: no problem
From production server in datacenter: no problem
From home: doesn't work at all. A always get the same error. (With a copy from the code that works at work) -
-
It sounds like your home's ISP is blocking outgoing 25/tcp (most residential ISP's do this). You can update your code to use the encrypted smtp ports:
Port 465: Used for SSL connections
Port 587: Used for TLS connections
Try setting up the smtpclient like this:
SmtpClient smtpClient = new SmtpClient("smtp.sendgrid.net", Convert.ToInt32(465));
smtpClient.EnableSsl=true; -
-
Sorry for reviving an old post. I've had the same problem (outgoing port 25 blocked on my home-connection).
Apparently System.Net.Mail only supports explicit SSL which means it has to be able to connect to port 25 before migrating to SSL.
Interestingly the old System.Web.Mail does support explicit SSL
More info here -
-
I experienced a similar issue in C# and was able to resolve it by using the TLS port (465) instead of the SSL port.
-
-
Not sure if it's ok to reply to this old post or if I should start a new thread ....
Anyway, I've tried all the port combinations and get the error below no matter what.
System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 174.36.32.204:465
Any ideas? -
Loading Profile...







