Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: dfurlano on March 14, 2011, 08:15:53 PM
-
Anyone ever write a VB script to send a text message to a phone via the internet?
Dan
-
YES, I will have to look it up and post it later. It works very well to keep you up to date on long runs
(;-) TP
OK HERE YOU GO, Your machine can call home. You wil have to fill in the account info stuff to math your settings and password.
'M3030 Macro
Message " MACHINE #549, Process COMPLETED Call Home"
Const cdoSendUsingPickup = 1 'Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 'Send the message using the network (SMTP over the network).
Const cdoAnonymous = 0 'Do not authenticate
Const cdoBasic = 1 'basic (clear-text) authentication
Const cdoNTLM = 2 'NTLM
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Machine Alert"
objMessage.From = """Machine #549"" <Machine#549@BR549.com>"
objMessage.To = "YOUR EMAIL ADDRESS.com"
objMessage.TextBody = "Machine #549 Process Completed.." & vbCRLF & "Thank You(;-)"
'==This section provides the configuration information for the remote SMTP server.
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "YOUR SMTP SERVER NAME"
'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
'Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "YOU ACCOUNT NAME ON THE SERVER"
'Your password on the SMTP server
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "YOU ACCOUNT PASSWORD"
'Server port (typically 25)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
'Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = False
'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objMessage.Configuration.Fields.Update
'==End remote SMTP server configuration section==
objMessage.Send
End
-
Thanks!
-
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Machine Alert"
objMessage.From = """Machine #549"" <Machine#549@BR549.com>" <-------------------------------- I am assuming here you put your email address
objMessage.To = "YOUR EMAIL ADDRESS.com" <------- and here you put your phone number? *********@vtext.com
objMessage.TextBody = "Machine #549 Process Completed.." & vbCRLF & "Thank You(;-)"
-
BTW:
The above does work with a Verizon cell phone *********@vtext.com
The standard port has now changed from port 25 to 587
Thanks again.
Dan