Question Emailing from access

Marvin1949

New member
Local time
Today, 17:39
Joined
Sep 22, 2009
Messages
1
I am currently sending quotes from a database as attachments using Outlook ie:
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)

I need to achiece the same outcome by bypassing outlook and either sending dirctly vie a designated mail server or via outlook express or possibly Thunderbird.

Can anyone help?
 
there have been hundred of threads on this topic in this forum already. just search here and you should find lots to keep you busy...
 
Here is another example of using SMTP

Code:
    Dim iMsg As Object
    Dim iConf As Object
    Dim Flds As Variant
    Dim tServer As String
    Dim tPort As Integer
    Dim tUser As String
    Dim tPass  As String
    
    Call GetEmailSettings(tServer, tPort, tUser, tPass)
 
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
 
    iConf.Load -1   
    Set Flds = iConf.Fields
    With Flds
      .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
      .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = tServer
      .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = tPort
      .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
      .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = tUser
      .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = tPass

      .Update
    End With
 
    With iMsg
        Set .Configuration = iConf
        .To = pTO
        .CC = ""
        .BCC = ""
        .From = pFrom
        .Subject = tSubject
        .TextBody = pMess
        If pAttrachPath <> "" Then .AddAttachment pAttrachPath
        .Send
    End With
 
    Set iMsg = Nothing
    Set iConf = Nothing
 

Users who are viewing this thread

Back
Top Bottom