Problem in sending email [modified]
-
I am writing a code which send Email to the respective email address. First time its working fine. But after sending my first email its not accept my program and I am not able to send email again. I put the code snippet here.
Dim smtpServer As New SmtpClient
Dim messageSTR As New MailMessage
Dim strAddress As New MailAddress("Email address", "Name")messageSTR.From = strAddress
messageSTR.To.Add("To Email Address")
messageSTR.Subject = Me.txtSub.Text
messageSTR.Body = Me.txtMailBody.TextsmtpServer.Host = "smtp.gmail.com"
smtpServer.Port = 578smtpServer.Credentials = New NetworkCredential("user id", "user pass")
smtpServer.EnableSsl = true
smtpServer.Send(messageSTR)What is the problem? Why I don't send the second mail? Exception Shown: 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 209.85.129.109:578. Error Message: Unable to connect to the remote server
modified on Friday, January 1, 2010 11:23 AM
-
I am writing a code which send Email to the respective email address. First time its working fine. But after sending my first email its not accept my program and I am not able to send email again. I put the code snippet here.
Dim smtpServer As New SmtpClient
Dim messageSTR As New MailMessage
Dim strAddress As New MailAddress("Email address", "Name")messageSTR.From = strAddress
messageSTR.To.Add("To Email Address")
messageSTR.Subject = Me.txtSub.Text
messageSTR.Body = Me.txtMailBody.TextsmtpServer.Host = "smtp.gmail.com"
smtpServer.Port = 578smtpServer.Credentials = New NetworkCredential("user id", "user pass")
smtpServer.EnableSsl = true
smtpServer.Send(messageSTR)What is the problem? Why I don't send the second mail? Exception Shown: 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 209.85.129.109:578. Error Message: Unable to connect to the remote server
modified on Friday, January 1, 2010 11:23 AM
Can you post the error details that you are getting.It'll be of helpful to give the relevent answer
Cheers!! Brij
-
I am writing a code which send Email to the respective email address. First time its working fine. But after sending my first email its not accept my program and I am not able to send email again. I put the code snippet here.
Dim smtpServer As New SmtpClient
Dim messageSTR As New MailMessage
Dim strAddress As New MailAddress("Email address", "Name")messageSTR.From = strAddress
messageSTR.To.Add("To Email Address")
messageSTR.Subject = Me.txtSub.Text
messageSTR.Body = Me.txtMailBody.TextsmtpServer.Host = "smtp.gmail.com"
smtpServer.Port = 578smtpServer.Credentials = New NetworkCredential("user id", "user pass")
smtpServer.EnableSsl = true
smtpServer.Send(messageSTR)What is the problem? Why I don't send the second mail? Exception Shown: 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 209.85.129.109:578. Error Message: Unable to connect to the remote server
modified on Friday, January 1, 2010 11:23 AM
The problem was, I am writing the invalid port number. I put portnumber=578 But it should be 587. Thanks.
-
The problem was, I am writing the invalid port number. I put portnumber=578 But it should be 587. Thanks.
-
The problem was, I am writing the invalid port number. I put portnumber=578 But it should be 587. Thanks.
-
At first, I send mail using default port number. Then I take it from the user and then creates the problem. Thanks