cancel
Showing results for 
Search instead for 
Did you mean: 

Unablr to send scripts by Sendmail method

SOLVED
Highlighted
Regular Contributor

Unablr to send scripts by Sendmail method

I am trying to send mail for all executed testItems.

But facing below error

"Unable to send email to the smtp.gmail.com server."

Error message: "Must issue a STARTTLS command first. n16sm4366861otk.25 - gsmtp

 

Below the code I am using.


Sub Test
.

Call Log.SaveResultsAs("C:\Users\Music\10feb\Logmera1.mht", lsMHT)

Test1()
End Sub


Function Test1
If SendMail("xyz@gmail.com", "smtp.gmail.com", "John Rliff", "master@gmail.com", "Test Complete Automation Report", "Hello Team, Kindly find the attachment.", "C:\Users\Music\10feb\Logmera1.mht") Then
Log.Message "Mail was sent"
Else
Log.Warning "Mail was not sent"
End If
End Function

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Staff

Hi @kaiiii ,

 

it seems from q cursory google search, (https://stackoverflow.com/questions/10509699/must-issue-a-starttls-command-first) that the error is related to gmail's authentication system rejeting the use of their servers for security reasons. 

From the document on the builtin sendmail functions, it seems that you have to enable some features within your gamil account to use TestComplete's builtin sendmail function

image.png

(https://support.smartbear.com/testcomplete/docs/scripting/sending-email-from-scripts.html)

in the "using CDO objects section"

Best,
Justin Kim

View solution in original post

Highlighted
Community Leader

Hi,

 

yes, that's right. If You want to send mail by Gmail You need to switch this bubble on:

 

https://myaccount.google.com/lesssecureapps

 

this link will get You directly to the website (if You are logged in)

 

also, it's important to use this parameter when You are sending an e-mail by google:

  • SMTP: smtp.gmail.com
  • Port: 465
  • SSL: true
  • smtpconnectiontimeout: 30
  • smtpauthenticate: 1

and i think that You also need to use the second solution from this Doc:

 

https://support.smartbear.com/testcomplete/docs/scripting/sending-email-from-scripts.html

View solution in original post

2 REPLIES 2
Highlighted
Staff

Hi @kaiiii ,

 

it seems from q cursory google search, (https://stackoverflow.com/questions/10509699/must-issue-a-starttls-command-first) that the error is related to gmail's authentication system rejeting the use of their servers for security reasons. 

From the document on the builtin sendmail functions, it seems that you have to enable some features within your gamil account to use TestComplete's builtin sendmail function

image.png

(https://support.smartbear.com/testcomplete/docs/scripting/sending-email-from-scripts.html)

in the "using CDO objects section"

Best,
Justin Kim

View solution in original post

Highlighted
Community Leader

Hi,

 

yes, that's right. If You want to send mail by Gmail You need to switch this bubble on:

 

https://myaccount.google.com/lesssecureapps

 

this link will get You directly to the website (if You are logged in)

 

also, it's important to use this parameter when You are sending an e-mail by google:

  • SMTP: smtp.gmail.com
  • Port: 465
  • SSL: true
  • smtpconnectiontimeout: 30
  • smtpauthenticate: 1

and i think that You also need to use the second solution from this Doc:

 

https://support.smartbear.com/testcomplete/docs/scripting/sending-email-from-scripts.html

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!


Challenge Status

Get properties of a web page element

See replies!

Compare images using the Region Checkpoint

See replies!

Compare HTML table with Excel file and correct data in Excel file

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!
Top Kudoed Authors