Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Must issue a STARTTLS command first

Status
Not open for further replies.

gogopoppy

Instructor
Mar 6, 2005
114
CA
Hi,

I'm sending an email message and my code below worked (at home) - the smtp setttings that I used didn't require a secure connection. I tried on different machine (clients) and got the message above. How can I add get this to go away?

Set objEmail = CreateObject("CDO.Message")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject ("WScript.Shell")

computerName = objShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
userName = objShell.ExpandEnvironmentStrings("%USERNAME%")
mailsubject="This is the subject"
mailbody="This is the body here"

objEmail.From = userName & "@domain.com"
objEmail.To = "gogo@sympatico.ca"
objEmail.Subject = mailSubject
objEmail.Textbody = "User: " & userName & " on computer \\" & computerName & " " & mailBody
objEmail.Configuration.Fields.Item _
(" = 2
objEmail.Configuration.Fields.Item _
(" = _
"smtp.gmail.com"
objEmail.Configuration.Fields.Item _
(" = 25
objEmail.Configuration.Fields.Update
objEmail.Send

Any help would be greatly appreaciated

Tx

Grd
 
Try adding this to your code...

obj.EnableSsl = true;

-- Jason
"It's Just Ones and Zeros
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top