I have used this code from Tom.  Perhaps it will help you.

'***** code start *****'
'Code by:  Tom Oakes 
'Personal PC Consultants, Inc. 
'[EMAIL PROTECTED] 
'503.230.0911 (O) 
'402.968.6946 (C) 
'734.264.0911 (F) 

Public Function SendCDOMail(strTo As String, strSubject As String,
strBody As String, strAttach As String, blnHTML As Boolean) As Boolean
On Error GoTo Failure
 
Dim objMessage As CDO.Message
Dim objConfig As CDO.Configuration
Dim objFields As Variant

Const cboSendUsingPort As Integer = 2

Set objConfig = New CDO.Configuration
Set objMessage = New CDO.Message
Set objFields = objConfig.Fields

With objFields
        
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing";) =
cdoSendUsingPort
        
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver";) =
GetSMTPServer()'<-- valid SMTP server
        
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontime
out") = 10
        
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport";) =
25
        .Update
End With

With objMessage
Set .Configuration = objConfig
.TO = strTo
.From = GetNTUSER & "@" & GetMailDomain()'<-- automatically uses current
user as "From"
        .Subject = strSubject
        If blnHTML = True Then
        .HTMLBody = strBody
        Else
        .TextBody = strBody
        End If
        If strAttach <> "" Then .AddAttachment (strAttach)
        .Send
End With

Set objMessage = Nothing
Set objFields = Nothing
Set objConfig = Nothing

SendCDOMail = True

EXITROUTINE:
        Exit Function
Failure:
        SendCDOMail = False
        MsgBox Err & " " & Err.Description
        Resume EXITROUTINE
End Function
'***** code end *****' 

Dawn Crosier
Application Specialist
"Education Lasts a Lifetime"
 
This message was posted to a newsgroup.  Please post replies and
questions to the group so that others can learn as well.
 

-----Original Message-----
From: AccessDevelopers@yahoogroups.com
[mailto:[EMAIL PROTECTED] On Behalf Of rock_jam
Sent: Monday, November 28, 2005 3:30 PM
To: AccessDevelopers@yahoogroups.com
Subject: [AccessDevelopers] Code to open Outlook and populate Subject
and recipients

Hello All,

I am new and hope you can help.  I have a table with email contacts.  
How do I open Outlook and populate the subject and recipients with the
emails in the table?  I am using Access 2003.
Thanks,
Andrew


------------------------ Yahoo! Groups Sponsor --------------------~--> 
1.2 million kids a year are victims of human trafficking. Stop slavery.
http://us.click.yahoo.com/WpTY2A/izNLAA/yQLSAA/q7folB/TM
--------------------------------------------------------------------~-> 


Please zip all files prior to uploading to Files section. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AccessDevelopers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to