My email server host has setup encryption on the email accounts that I am sending out reports through, they just did so this weekend with no warning. They say I should be using STARTTLS for the encryption, though with another tool I use I noticed I was able to successfully use TLS set to Explicit. I found the settings which refer to using SSL/TLS and set that to .t., but am still unable to connect to the server – it is just saying connection refused. I have just upgraded to the latest version 7.27 but am still getting the same result. What is my solution, or next step to figuring this out? Thanks.
Here is the code I am using:
*** Build and Send eMail
LOCAL loSmtp
*** Load required libraries
DO wwSmtp
LOCAL loSmtp as wwSmtp
loSmtp = CREATEOBJECT("wwSmtp")
*** Select mail mode. 0 - .NET wwSmtp 2 - Classic wwIPstuff
*** Note: Mode 2 only supports SendMail and SendMailAsync
*** and no support for alternate views
**loSmtp.nMailMode = 2
loSmtp.nMailMode = 0
*** DeliveryList.net Email Server
loSmtp.cMailServer = "netsol-smtp-oxcs.hostingplatform.com"
*** Timeout in seconds
loSmtp.nTimeout = 25
*** Optionally use SSL/TLS if the mail server requires it
loSmtp.lUseSsl = .T.
*** specify user name and password
loSmtp.cUsername = "UserName"
loSmtp.cPassword = "Password"
loSmtp.cSenderName= "SenderName"
loSmtp.cSenderEmail = "NoReply_DeliveryList@Domain"
loSmtp.cRecipient = (m.recipientList)
*** Actual message properties
loSmtp.cSubject = m.RptFileName
loSmtp.cMessage = m.Client + ", file attached: " + m.RptFileName
*** If cMessage contains HTML set cContentType to text/html
loSmtp.cContentType = "text/html"
*** Optional properties
*loSmtp.cReplyTo = "NoReply@Domain"
loSmtp.cPriority = "Normal"
*** To add attachments use Attachment and point at a full file path
loSmtp.AddAttachment((m.RptPathFileName))
*** Add any custom headers that properties don't cover
loSmtp.AddHeader("x-mailer",(m.AppName))
*** Single Mail Sending - connect/disconnect for message
llResult = loSmtp.SendMail()
IF llResult
WAIT WINDOW "Mail sent..."
ELSE
WAIT WINDOW "Mail sending failed: " + loSmtp.cErrorMsg
ENDIF
Probably the wrong port. If using SSL/TLS the port is almost always something other than the default port of 25
which is the non-encrypted port.
+++ Rick ---
Thanks Rick, I noticed I didn't specify the port in the loSMTP.cMailServer entry that I posted, sorry, this is what I have been using which should set the port, correct? "netsol-smtp-oxcs.hostingplatform.com:587"