Asked by:
How do I send email using TLS in Access 2010

Question
-
In Access 2010 the client upgrade to Outlook 365. I need change my code from SSL to TLS. Here is the code I had before. What changes do I need to make? --Thanks Keith
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.live.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 ---- Change here for TLS??
'.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True 'Use SSL for the connection (True or False)
'If your server requires outgoing authentication uncomment the lines blow and use a valid email address and password.
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = ""
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "?Monday, November 21, 2016 4:43 PM
All replies
-
See:
Also, taken from http://stackoverflow.com/questions/12812408/is-there-some-trick-to-making-vbscript-cdo-work-with-amazon-ses-smtp:
"CDO does not support TLS, but only SSL"
and again taken from http://www.codekabinett.com/rdumps.php?Lang=2&targetDoc=send-email-access-vba-cdo:
"Some mail servers do not support implicit SSL connections on port 465 but only explicit TLS connections on port 587. This unfortunately is not supported by the CDO Library."
Here are a few more links that might be useful:
Daniel Pineault, 2010-2016 Microsoft MVP Professional Support: http://www.cardaconsultants.com MS Access Tips and Code Samples: http://www.devhut.net
- Edited by Daniel Pineault (MVP)MVP Monday, November 21, 2016 6:01 PM
Monday, November 21, 2016 5:57 PM -
Hi Keith 10k,
First download the EASendMail Installer and install it.
then you need to reference to "EASendMailObj ActiveX Object".
use the code mentioned below.
Private Sub btnSendMail_Click() Dim oSmtp As New EASendMailObjLib.Mail oSmtp.LicenseCode = "TryIt" ' Set your sender email address oSmtp.FromAddr = "test@emailarchitect.net" ' Add recipient email address oSmtp.AddRecipientEx "support@emailarchitect.net", 0 ' Set email subject oSmtp.Subject = "simple email from VB 6.0 project" ' Set email body oSmtp.BodyText = "this is a test email sent from VB 6.0 project, do not reply" ' Your SMTP server address oSmtp.ServerAddr = "smtp.emailarchitect.net" ' User and password for ESMTP authentication, if your server doesn't require ' User authentication, please remove the following codes. oSmtp.UserName = "test@emailarchitect.net" oSmtp.Password = "testpassword" ' Set 25 SMTP port oSmtp.ServerPort = 25 ' Enable TLS connection oSmtp.SSL_starttls = 1 oSmtp.SSL_init MsgBox "start to send email ..." If oSmtp.SendMail() = 0 Then MsgBox "email was sent successfully!" Else MsgBox "failed to send email with the following error:" & oSmtp.GetLastErrDescription() End If End Sub
Reference:
VB6 - Send Email over TLS on 25 or 587 port
Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.
Regards
Deepak
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.Tuesday, November 22, 2016 6:24 AM -
Do note though that this required installing the ActiveX on every computer! and ActiveX are known for versioning issues. It may very well work, but wouldn't be my first choice. I avoid all ActiveX like the plague. Actually, in over 10-15+ years of development I've only ever used an ActiveX control once and it bite me in the @@#@! after MS performed an update, so I eneded up replacing even that.
If you're in a controlled Enterprise environment maybe consider it. If, on the other hand, you're try to develop something to deploy at large, stay away!
Lastly, this appears to be an ActiveX from a 3rd party. so you'd better validate licensing and support?
Daniel Pineault, 2010-2016 Microsoft MVP
Professional Support: http://www.cardaconsultants.com
MS Access Tips and Code Samples: http://www.devhut.net
- Edited by Daniel Pineault (MVP)MVP Tuesday, November 22, 2016 1:39 PM
Tuesday, November 22, 2016 1:37 PM -
Here's a paper we recently wrote that offers additional information on how to configure Office365's SMTP server to allow email relaying and delegation.
There are also two login options with a specific email account or authorized IP address of the sender:
http://fmsinc.com/MicrosoftAccess/Email/smtp/index.htm
Hope this helps.Luke Chung
Microsoft MVP
President of FMS, Inc.
Blog Facebook Twitter- Proposed as answer by Deepak Saradkumar PanchalMicrosoft contingent staff Thursday, October 12, 2017 8:53 AM
Tuesday, September 5, 2017 8:00 PM