Hi,
I am trying to send email from promotic application using gmail account. I Keep on getting error as shown below.
The message could not be sent to the SMTP server. The transport error code was 0x80040217.The server response was not available.
Any help in solving this problem?
Thanks.
================================================================================================================
I am using following code
'1 = Send message using the local SMTP service pickup directory
'2 = Send the message using the network (SMTP over the network)
nSendUsing = 2
'Name or IP of Remote SMTP Server
sSmtpServer = "smtp.gmail.com"
'Type of authentication, NONE=0, Basic=1 (Base64 encoded), NTLM=2
nSmtpAuthenticate = 1
'Your UserID on the SMTP server
sUserName ="Bhalchandra Gondhalekar" & "<b.gondhalekar@gmail.com>"
'Your password on the SMTP server
sPassword = "******"
'Server port (typically 25, 465, 587)
nSmtpServerPort = 465
'Use SSL for the connection (false or true)
bSmtpUseSsl = true
'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
nSmtpConnectionTimeout = 60
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Test email from Promotic"
objMessage.From = "Bhalchandra Gondhalekar" & "<b.gondhalekar@gmail.com>"
objMessage.To = "b.gondhalekar@gmail.com"
objMessage.TextBody = "Test email from Promotic.." & vbCrLf & "It was sent using SMTP authentication."
'objMessage.HTMLBody = "<h1>Test email from Promotic..</h1><p>It was sent using SMTP authentication.</p>"
'objMessage.Addattachment "c:\temp\Text.txt"
'==This section provides the configuration information for the remote SMTP server==
Set oFlds = objMessage.Configuration.Fields
oFlds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = nSendUsing
oFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = sSmtpServer
oFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = nSmtpAuthenticate
oFlds.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = sUserName
oFlds.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = sPassword
oFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = nSmtpServerPort
oFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = bSmtpUseSsl
oFlds.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = nSmtpConnectionTimeout
oFlds.Update
'==End remote SMTP server configuration section==
objMessage.Send