I am running access 2010. I have a table with email address' as one of the fields. I want to send the same message to all or some of my contacts. The table is named Donors and the field is Email address. I am using outlook express for my e-mail.
How can I Send E-Mail from an Access Table using MS Outlook
Collapse
X
-
Outlook Express is not an MS Office application, and as such is not likely to fall within the experience range of most of our experts.
Application Automation may help some, but that's as far as I can go with the Outlook Express part I'm afraid. -
Outlook is well set up to be controlled from within Access. Your question title indicates you're using Outlook Express though. This new post is a contradiction of that so you won't be surprised to find we're somewhat confused at this point.
Please clarify before continuing.Last edited by NeoPa; Jan 31 '12, 05:28 PM.Comment
-
The Logic would be as follows, any questions feel free to ask.
Code:Dim oLook As Object Dim oMail As Object Dim olns As Outlook.NameSpace Dim strTO As String Dim strMessageBody As String Dim strSubject As String Dim MyDB As DAO.Database Dim rst As DAO.Recordset 'Do you even have E-Mail Addressess in the Donors Table? '[E-Mail Address] cannot be NULL If DCount("[E-Mail Address]", "Donors") = 0 Then Exit Sub Set MyDB = CurrentDb Set rst = MyDB.OpenRecordset("Donors", dbOpenSnapshot, dbOpenForwardOnly) Set oLook = CreateObject("Outlook.Application") Set olns = oLook.GetNamespace("MAPI") Set oMail = oLook.CreateItem(0) 'Build the Recipient List With rst Do While Not .EOF strTO = strTO & ![E-Mail Address] & ";" .MoveNext Loop End With 'Remove Trailing ';' strTO = Left$(strTO, Len(strTO) - 1) '******************************* USER DEFINED SECTION ******************************** strMessageBody = "Message to ALL Recipients " strSubject = "Test Project for E-Mailing Multiple Recipients in Outlook" '************************************************************************************* With oMail .To = strTO .Body = strMessageBody .Subject = strSubject '.Display .Send 'Immediately Sends the E-Mail without displaying Outlook End With Set oMail = Nothing Set oLook = Nothing rst.Close Set rst = NothingComment
-
Right. With that cleared up (I've updated the thread title for you) I can probably leave you in ADezii's capable hands. He's a dab-hand at Outlook automation from Access. I'll keep an eye on this though, in case I can help at any stage.Originally posted by HogueHogue:
Sorry, my mail is through Outlook, not Outlook express.Comment
-
Comment