I am creating an app where I want to be able to send email using Gmail, Yahoo or Hotmail through SMTP. I have been able to get it to work with Gmail and Yahoo, but not with Hotmail. Since SMTP access to Hotmail has only been available for a short time there doesn't seem to be much information available about how to do it.
I am using Delphi 7.0 and Indy 9.0 (TIdSMTP and TIdSSLIOHandlerSocket components). Here are the properties of those components that I am using:
For Hotmail, I use port 587 because I found a couple of posts saying that's the correct one to use. With that port, I get an "error connecting with SSL" error when I try to connect. I tried port 465 and got "socket error #10060: connection timed out". If anyone knows the correct settings for Hotmail I would like to hear about it.
Glenn
I am using Delphi 7.0 and Indy 9.0 (TIdSMTP and TIdSSLIOHandlerSocket components). Here are the properties of those components that I am using:
Code:
// For Gmail
object IdSMTP_Gmail: TIdSMTP
IOHandler = IdSSLIOHandlerSocket1
MaxLineAction = maException
ReadTimeout = 0
Host = 'smtp.gmail.com'
Port = 465
AuthenticationType = atLogin
Password = 'xxxx'
Username = 'xxxx@gmail.com'
end
// For Yahoo
object IdSMTP_Yahoo: TIdSMTP
IOHandler = IdSSLIOHandlerSocket1
MaxLineAction = maException
ReadTimeout = 0
Host = 'smtp.mail.yahoo.com'
Port = 465
AuthenticationType = atLogin
Password = 'xxxx'
Username = 'xxxx'
end
// For Hotmail
object IdSMTP_Hotmail: TIdSMTP
IOHandler = IdSSLIOHandlerSocket1
MaxLineAction = maException
ReadTimeout = 0
Host = 'smtp.live.com'
Port = 587
AuthenticationType = atLogin
Password = 'xxxx'
Username = 'xxxx@hotmail.com'
end
// For all the above
object IdSSLIOHandlerSocket1: TIdSSLIOHandlerSocket
OnStatus = IdSSLIOHandlerSocket1Status
SSLOptions.Method = sslvSSLv2
SSLOptions.Mode = sslmUnassigned
SSLOptions.VerifyMode = []
SSLOptions.VerifyDepth = 0
end
For Hotmail, I use port 587 because I found a couple of posts saying that's the correct one to use. With that port, I get an "error connecting with SSL" error when I try to connect. I tried port 465 and got "socket error #10060: connection timed out". If anyone knows the correct settings for Hotmail I would like to hear about it.
Glenn