[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.0

problem connection to mail server using system.net.mail

Asked by straubtm in Microsoft Visual Basic.Net

Tags: smtp

We are currently using VB.NET 2.0 in VS 2005 and have attempted to use the new System.Net.Mail framework to send SMTP mail.  Also, our email server requires smtp authentication.

Unfortunately, we continue to receive the following error:

Server Error in '/ESB3' Application.
________________________________________
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
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: 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

Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:
[SocketException (0x274c): 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]
   System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +1002146
   System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +33
   System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +431

[WebException: Unable to connect to the remote server]
   System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) +1447736
   System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) +190
   System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) +21
   System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) +318
   System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) +227
   System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) +316
   System.Net.Mail.SmtpClient.GetConnection() +42
   System.Net.Mail.SmtpClient.Send(MailMessage message) +1485

[SmtpException: Failure sending mail.]
   System.Net.Mail.SmtpClient.Send(MailMessage message) +2074
   Modules_General_ForgotPassword.EmailNewUnhashedPwd(String UserID, String UnhashedPwd, String ToAddress) +420
   Modules_General_ForgotPassword.RequestNewPassword(String UserID_or_Email) +559
   Modules_General_ForgotPassword.btn_RequestNewPwd_Click(Object sender, EventArgs e) +48
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +5102

________________________________________
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42



Here is a sanitized version of the code used to generate the email.

Dim mailMessage As Net.Mail.MailMessage = New Net.Mail.MailMessage
        mailMessage.From = New Net.Mail.MailAddress("xyz@company.com")
        mailMessage.To.Add(New Net.Mail.MailAddress("john.doe@company.com"))
        mailmessage.Subject = "This is the subject."
        mailMessage.Priority = System.Net.Mail.MailPriority.High
        mailMessage.IsBodyHtml = True
        mailmessage.Body = “<B>Hello World</B>”
        Dim mailClient As New System.Net.Mail.SmtpClient("mail.company.com", 25)
        mailClient.Credentials = New Net.NetworkCredential("(username)", "(password)")
        mailClient.UseDefaultCredentials = False
        mailClient.Send(mailMessage)
        mailMessage.Dispose()


Thanks in advance,
-Tim
[+][-]07/12/06 06:21 AM, ID: 17090217Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/12/06 07:50 AM, ID: 17091033Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Microsoft Visual Basic.Net
Tags: smtp
Sign Up Now!
Solution Provided By: straubtm
Participating Experts: 1
Solution Grade: A
 
[+][-]07/12/06 07:50 AM, ID: 17091037Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/12/06 08:08 AM, ID: 17091235Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-89