Question : MS Access 2003 - sending email

Dear Experts,
I have a MS Access 2003 database and MS Outlook. I want to enter a customer enquiry into the database (to include name and phone no) and have these 2 details emailed automatically to the sales team.

thank you for any help

Answer : MS Access 2003 - sending email

You could use Outlook to send the email, but have you ever tried using CDO?  CDO is available on all Windows 2000 and higher machines.  The cool part is that CDO does not even require an email client to work, just a valid smtp server address (ex: "smtp.mail.yahoo.com").
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
Sub SendEmail_CDO(ByVal sendto As String, ByVal subject As String, ByVal body As String, ByVal server As String)
    Dim iMsg As Object
    Dim iConf As Object
    Dim Flds As Object
 
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = CreateObject("CDO.Configuration")
 
    iConf.Load -1 ' CDO Source Defaults
    Set Flds = iConf.Fields
    With Flds
        .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = server
        .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        .Update
    End With
 
    With iMsg
        Set .Configuration = iConf
        .to = sendto
        .CC = ""
        .BCC = ""
        .From = """TEST"" "
        .subject = subject
        .TextBody = body
        .Send
    End With
End Sub
Random Solutions  
 
programming4us programming4us