123
Senior Member
Premise's GetMailer function lets you send email via plain vanilla SMTP (unsecure and unauthenticated). However, it does not support authentication nor SSL so it is incapable of sending email via Gmail.
Fortunately, your PC is already capable of sending secure and authenticated email if it is equipped with CDOSYS. I've confirmed CDOSYS exists on Windows XP and Vista. Its purpose is to send email and it can authenticate with an SMTP server as well as encrypt the transmission using SSL (no need for stunnel) ... so it works with Gmail.
Here's a simplified example from Paul Sadowski's site:
NOTE
Please be aware that CDOSYS sends mail synchronously ... that means when "objMessage.Send" is executed, nothing else will run until the email has been sent. It may take several seconds to transmit the message and during this time, Premise's scripting engine will pause and do nothing until the message is transmitted (or times out). This could affect other scripts that use timers and expect stuff to happen within tight time constraints.
Fortunately, your PC is already capable of sending secure and authenticated email if it is equipped with CDOSYS. I've confirmed CDOSYS exists on Windows XP and Vista. Its purpose is to send email and it can authenticate with an SMTP server as well as encrypt the transmission using SSL (no need for stunnel) ... so it works with Gmail.
Here's a simplified example from Paul Sadowski's site:
Code:
' Compose message
Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "My Subject"
objMessage.From = """Me"" <[email protected]>"
objMessage.To = "[email protected]"
objMessage.TextBody = "Hello!"
' Configuration
sPath = "http://schemas.microsoft.com/cdo/configuration/"
with objMessage.Configuration.Fields
.Item (sPath & "sendusing") = 2
.Item ((sPath & "smtpserver") = "smtp.gmail.com"
.Item (sPath & "smtpauthenticate") = 1
.Item (sPath & "sendusername") = "[email protected]"
.Item (sPath & "sendpassword") = "MyGmailPassword"
.Item (sPath & "smtpserverport") = 465
.Item (sPath & "smtpusessl") = True
.Item (sPath & "smtpconnectiontimeout") = 60
end with
objMessage.Configuration.Fields.Update
' Send the message
objMessage.Send
NOTE
Please be aware that CDOSYS sends mail synchronously ... that means when "objMessage.Send" is executed, nothing else will run until the email has been sent. It may take several seconds to transmit the message and during this time, Premise's scripting engine will pause and do nothing until the message is transmitted (or times out). This could affect other scripts that use timers and expect stuff to happen within tight time constraints.