R
Rob Dob
The following code is giving me a timeout problem., no matter what I do I
can't send a piece of mail using .net2.0 System.Net.Mail.SmtpClient via port
465 and using ssl, if however I try using outlook or outlook express it
works fine..
System.Net.Mail.MailMessage msgMail = new
System.Net.Mail.MailMessage("(e-mail address removed)",
"(e-mail address removed)", "subject", "message body");
SmtpClient smtp = new SmtpClient("smtp.postoffice.net", 465);
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = false;
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.Credentials = new System.Net.NetworkCredential([email protected],
"mypassword");
try
{
// the following line is where it times out
smtp.Send(msgMail);
}
catch (Exception ex)
{
}
I also did a trace log and this is what it looks like...
System.Net Information: 0 : [5260] Associating MailMessage#61058004 with
Message#63255637
System.Net Verbose: 0 : [5260] SmtpClient::.ctor(host=smtp.postoffice.net,
port=465)
System.Net Information: 0 : [5260] Associating SmtpClient#27931403 with
SmtpTransport#48953616
System.Net Verbose: 0 : [5260] Exiting SmtpClient::.ctor() ->
SmtpClient#27931403
System.Net Verbose: 0 : [5260]
SmtpClient#27931403::Send(MailMessage#61058004)
System.Net Information: 0 : [5260]
SmtpClient#27931403::Send(DeliveryMethod=Network)
System.Net Information: 0 : [5260] Associating SmtpClient#27931403 with
MailMessage#61058004
System.Net Information: 0 : [5260] Associating SmtpTransport#48953616 with
SmtpConnection#55429074
System.Net Information: 0 : [5260] Associating SmtpConnection#55429074 with
ServicePoint#11280399
System.Net Information: 0 : [5260] Associating SmtpConnection#55429074 with
SmtpPooledStream#37855919
System.Net Error: 0 : [5260] Exception in the SmtpClient#27931403::Send -
Unable to read data from the transport connection: A blocking operation was
interrupted by a call to WSACancelBlockingCall.
System.Net Error: 0 : [5260] at
System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32
size)
at System.Net.DelegatedStream.Read(Byte[] buffer, Int32 offset, Int32
count)
at System.Net.BufferedReadStream.Read(Byte[] buffer, Int32 offset, Int32
count)
at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader
caller, Boolean oneLine)
at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader
caller)
at System.Net.Mail.SmtpReplyReader.ReadLine()
at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port)
at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)
at System.Net.Mail.SmtpClient.GetConnection()
at System.Net.Mail.SmtpClient.Send(MailMessage message)
System.Net Verbose: 0 : [5260] Exiting SmtpClient#27931403::Send()
can't send a piece of mail using .net2.0 System.Net.Mail.SmtpClient via port
465 and using ssl, if however I try using outlook or outlook express it
works fine..
System.Net.Mail.MailMessage msgMail = new
System.Net.Mail.MailMessage("(e-mail address removed)",
"(e-mail address removed)", "subject", "message body");
SmtpClient smtp = new SmtpClient("smtp.postoffice.net", 465);
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = false;
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.Credentials = new System.Net.NetworkCredential([email protected],
"mypassword");
try
{
// the following line is where it times out
smtp.Send(msgMail);
}
catch (Exception ex)
{
}
I also did a trace log and this is what it looks like...
System.Net Information: 0 : [5260] Associating MailMessage#61058004 with
Message#63255637
System.Net Verbose: 0 : [5260] SmtpClient::.ctor(host=smtp.postoffice.net,
port=465)
System.Net Information: 0 : [5260] Associating SmtpClient#27931403 with
SmtpTransport#48953616
System.Net Verbose: 0 : [5260] Exiting SmtpClient::.ctor() ->
SmtpClient#27931403
System.Net Verbose: 0 : [5260]
SmtpClient#27931403::Send(MailMessage#61058004)
System.Net Information: 0 : [5260]
SmtpClient#27931403::Send(DeliveryMethod=Network)
System.Net Information: 0 : [5260] Associating SmtpClient#27931403 with
MailMessage#61058004
System.Net Information: 0 : [5260] Associating SmtpTransport#48953616 with
SmtpConnection#55429074
System.Net Information: 0 : [5260] Associating SmtpConnection#55429074 with
ServicePoint#11280399
System.Net Information: 0 : [5260] Associating SmtpConnection#55429074 with
SmtpPooledStream#37855919
System.Net Error: 0 : [5260] Exception in the SmtpClient#27931403::Send -
Unable to read data from the transport connection: A blocking operation was
interrupted by a call to WSACancelBlockingCall.
System.Net Error: 0 : [5260] at
System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32
size)
at System.Net.DelegatedStream.Read(Byte[] buffer, Int32 offset, Int32
count)
at System.Net.BufferedReadStream.Read(Byte[] buffer, Int32 offset, Int32
count)
at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader
caller, Boolean oneLine)
at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader
caller)
at System.Net.Mail.SmtpReplyReader.ReadLine()
at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port)
at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port)
at System.Net.Mail.SmtpClient.GetConnection()
at System.Net.Mail.SmtpClient.Send(MailMessage message)
System.Net Verbose: 0 : [5260] Exiting SmtpClient#27931403::Send()