WinBatch Technical Support Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Current release
:
2023C (6.23CWC)
Home
Help
Search
Tech Database
Documentation
Downloads
Hints
Login
Register
WinBatch® Technical Support Forum
»
All Things WinBatch
»
WinBatch
»
CDO SSL Send SMS Text Message Via Gmail Verizon.
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: CDO SSL Send SMS Text Message Via Gmail Verizon. (Read 2365 times)
morenos1
Jr. Member
Posts: 84
CDO SSL Send SMS Text Message Via Gmail Verizon.
«
on:
July 17, 2018, 09:55:10 am »
Found script in Tech DB.
;*===========================================================================================
;* Send SMS Text message through GMAIL account using CDO
;*
;* Check the following link for detailed help on the CDO Schemas
;*
http://msdn2.microsoft.com/en-us/library/ms872380.aspx
;*
;*===========================================================================================
; Error handling
IntControl(73,1,0,0,0)
;-----------------------------------------------------------
; Modify to fit your needs.
;-----------------------------------------------------------
gmailacctid = 'soandso'
gmailacctPswd = 'secret'
;
;Carriers:
;
; Verizon
; no_attachments = "@vtext.com"
; attachements = "@vzwpix.com"
; AT&T
; no_attachments = "@txt.att.net"
; attachements = "@mobile.att.net"
; Sprint
; no_attachments = "@messaging.sprintpcs.com"
; attachements = "@messaging.sprintpcs.com"
; T-Mobile
; no_attachments = "@tmomail.net"
; attachements = "@tmomail.net"
strTo = '5558675309@vtext.com' ;Modify to approprate 'carrier'
Subject = "Test Email"
TextBody = "Send SMS Text message through GMAIL account using CDO"
Attachment = ""
;-----------------------------------------------------------
; GMAIL Server settings
SMTPServer = "smtp.gmail.com"
AcctName = gmailacctid: "@gmail.com"
Authenticate = 1
UserName = AcctName
Password = gmailacctPswd
SSL = "YES"
SendUsing = 2
From = AcctName
strCc = ""
strBCC = ""
oMsg = ObjectCreate("CDO.Message")
oConf = ObjectCreate("CDO.Configuration")
oFields = oConf.Fields
; Define CDO Schemas
oFields.Item("
http://schemas.microsoft.com/cdo/configuration/smtpserver
") = SMTPServer
oFields.Item("
http://schemas.microsoft.com/cdo/configuration/smtpserverport
") = 465
oFields.Item("
http://schemas.microsoft.com/cdo/configuration/smtpaccountname
") = AcctName
oFields.Item("
http://schemas.microsoft.com/cdo/configuration/smtpauthenticate
") = Authenticate
oFields.Item("
http://schemas.microsoft.com/cdo/configuration/sendusername
") = UserName
oFields.Item("
http://schemas.microsoft.com/cdo/configuration/sendpassword
") = Password
oFields.Item("
http://schemas.microsoft.com/cdo/configuration/smtpusessl
")= @TRUE
oFields.Item("
http://schemas.microsoft.com/cdo/configuration/sendusing
")= SendUsing
oFields.Item("
http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout
")= 60 ; Default is 60 Seconds
oFields.Update()
;Send Message
oMsg.Configuration = oConf
oMsg.To = strTo
oMsg.CC = strCC
oMsg.BCC = strBCC
oMsg.From = From
oMsg.Subject = Subject
oMsg.TextBody = TextBody
If Attachment != "" Then oMsg.AddAttachment(Attachment)
oMsg.Send()
oMsg = 0
oConf = 0
oFields = 0
Exit
:WBERRORHANDLER
Pause( "Captured CDO Email Error", LastError():' ':wberrortextstring:@CRLF:@CRLF:"On line:":@CR:wberrorhandlerline)
oMsg = 0
oConf = 0
oFields = 0
Exit
When attempting to run on Win10 I am getting:
1261 COM/CLR: Exception
Line: oMsg.Send()
Any ideas why?
Thanks....
Logged
td
Tech Support
Posts: 4287
Re: CDO SSL Send SMS Text Message Via Gmail Verizon.
«
Reply #1 on:
July 17, 2018, 11:13:14 am »
You can't send email messages using Google's SMTP server unless you specify that you want to allow "unsafe" applications to access your account so that is the first thing to check. Can't tell you exactly where that setting is but you can likely find out by "Googling" it...
Logged
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
- Dr. Tom Cade
morenos1
Jr. Member
Posts: 84
Re: CDO SSL Send SMS Text Message Via Gmail Verizon.
«
Reply #2 on:
July 17, 2018, 11:54:27 am »
Found it:
2.Visit the page
https://www.google.com/settings/security/lesssecureapps
3.Click Enable Less Secure Apps.
4.Click Done.
Thank you....
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
WinBatch® Technical Support Forum
»
All Things WinBatch
»
WinBatch
»
CDO SSL Send SMS Text Message Via Gmail Verizon.