Author |
|
Dandi18 Newbie
Joined: 08 October 2008 Location: Israel
Online Status: Offline Posts: 4
|
Posted: 27 October 2010 at 7:18am | IP Logged
|
|
|
Hi,
if you can tell me what am i doing wrong (didnt use this component 2 years)
i get a timeout error
Code:
Dim mailer As New Smtp
Dim server As SmtpServer = New SmtpServer("smtp.gmail.com", "XXX@Gmail.com", "XXX")
server.SslMode = SslStartupMode.UseStartTls
server.SslProtocol = MailBee.Security.SecurityProtocol.Auto
server.AuthMethods = AuthenticationMethods.Auto
server.Port = 465
mailer.SmtpServers.Add(server)
mailer.From.Email = "xxx@Gmail.com"
mailer.To.Add("xxx@gmail.com")
mailer.Subject = "Report"
mailer.BodyPlainText = "The report contents"
mailer.Log.Enabled = True
mailer.Log.Filename = Application.StartupPath & "\log.txt"
mailer.Send()
Log:
[16:09:36.05] [INFO] Assembly version: 3.1.2.90.
[16:09:36.05] [INFO] Will send mail message.
[16:09:36.14] [INFO] Will resolve host "smtp.gmail.com".
[16:09:36.18] [INFO] Host "smtp.gmail.com" resolved to IP address(es) 74.125.39.109.
[16:09:36.18] [INFO] Will connect to host "smtp.gmail.com" on port 465.
[16:09:36.27] [INFO] Socket connected to IP address 74.125.39.109 on port 465.
[16:09:56.85] [INFO] Will disconnect from host "smtp.gmail.com".
[16:09:56.85] [INFO] Disconnected from host "smtp.gmail.com".
[16:09:56.85] [INFO] Error: Socket connection has timed out. InnerException message follows: 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
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 27 October 2010 at 7:29am | IP Logged
|
|
|
UseStartTls option assumes you're using regular port and not dedicated one; although, port 587 might work in such case. Just omit that Port line and see if it works.
We have a tutorial on sending mails via GMail SMTP.
BTW, you're using VERY outdated build, upgrading is highly recommended.
--
Regards,
Igor, AfterLogic Support
|
Back to Top |
|
|
Dandi18 Newbie
Joined: 08 October 2008 Location: Israel
Online Status: Offline Posts: 4
|
Posted: 28 October 2010 at 1:04am | IP Logged
|
|
|
Thanks alot for the quick reply
changed it to port 587 and it works fine
|
Back to Top |
|
|