Sending email from Promotic Usinf gmail account

This is the main technical forum for discussing problems that were encountered by users while developing PROMOTIC applications, and their possible solutions.

Sending email from Promotic Usinf gmail account

Postby Gondhalekar » Mon 18. Aug 2014 7:15:06

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
Gondhalekar
 
Posts: 4
Joined: Fri 11. Apr 2014 8:22:54

Re: Sending email from Promotic Usinf gmail account

Postby admin » Mon 25. Aug 2014 8:20:51

Hello,

We have checked the code and it seems like there is an error here:

sUserName ="Bhalchandra Gondhalekar" & "<b.gondhalekar@gmail.com>"

The whole string is very unlikely to be a correct login name for SNMP server. Usually the e-mail address itself can be used as login name, but it is server dependent.

Please doublecheck the correct login name.
admin
Administrátor
 
Posts: 69
Joined: Wed 12. Dec 2012 15:43:09

Re: Sending email from Promotic Usinf gmail account

Postby Gondhalekar » Mon 01. Sep 2014 5:47:52

Hello,

Tried with only email Id as Login Name and was able to send email. Thanks a lot for your help !!!
Gondhalekar
 
Posts: 4
Joined: Fri 11. Apr 2014 8:22:54


Return to I don't know how to...

Who is online

Users browsing this forum: No registered users and 4 guests