Dan Waters
dwaters at usinternet.com
Sat Dec 20 14:29:07 CST 2003
Fred, This code tells me a lot - Thanks! Does this work with any version of CDO? Thanks, Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Fred Hooper Sent: Saturday, December 20, 2003 12:40 PM To: 'Access Developers discussion and problem solving' Subject: RE: [AccessD] Route email to SMTP Server from Access Hi Dan, Here's the way I'm doing it: Public Sub SendEmail(strFrom As String, strTo As String, strSubject As String, strMessage As String) Dim objEmail As Object Dim objMsg As Object Dim objConf As Object Dim Flds As Variant Set objMsg = CreateObject("cdo.message") Set objConf = CreateObject("cdo.configuration") Set Flds = objConf.Fields With Flds ' The first item with value "2" indicates that smpt not installed on this machine .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ' Next item is the name of the smpt server to use. ' Look in Outlook | Tools | Email Accounts | View or change... | Change to find .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "<exchange server name" ' This is the port the smpt server uses, 25 is the default .Item("http://schemas.microsoft.com/cdo/configuration/smptserverport") = 25 .Update End With With objMsg Set .configuration = objConf .To = strTo .From = strFrom .Subject = strSubject .Textbody = strMessage .Fields.Update .Send End With Set objMsg = Nothing Set objConf = Nothing End Sub |-----Original Message----- |From: accessd-bounces at databaseadvisors.com |[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Dan Waters |Sent: Wednesday, December 17, 2003 2:55 PM |To: Database Advisors |Subject: [AccessD] Route email to SMTP Server from Access | | |Hello and Happy Holidays to everyone! | |I have a customer I am getting started with. To send email |and get around the Outlook security patch, I suggested either |using Redemption or using the Outlook Security Administrator's |package. I then received the suggestion to try sending email |straight to the SMTP server, bypassing the security problem. | |What seems to be required to do this is to either use CDO, of |which there are different versions (CDO, CDONTS, and CDOSYS), |or a 3rd party product. Is this really correct or is there |another way? Perhaps a Windows API that can be used for the |same purpose? | |I did do a search on the archives for SMTP, but because many |people's emails have SMTP in the email header, the search was |not useful. | |Anyone have an early Christmas present they can give me? | |Thanks! |Dan Waters |Quality Process Solutions. |_______________________________________________ |AccessD mailing list |AccessD at databaseadvisors.com |http://databaseadvisors.com/mailman/listinfo/ac|cessd |Website: |http://www.databaseadvisors.com | _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com