Creating a VBA in Access 2013 To Send Emails

bookworm4170

New member
Local time
Today, 03:31
Joined
May 13, 2013
Messages
2
I'm trying to create a VBA in Access 2013 (I have Microsoft Office 365) that will pull the following information from a database (To, CC, BCC, Subject, Message Body and/or attach a PDF file). There will be about 1000 emails that will be going out and I need to send them outside of my IP.

The VBA will also need to create the PDF file if it meets a certain criteria and I'd need it to not insert empty fields.

Please let me know if you need any additional information.

Thank you.

Danita
 
If you're looking to export rather than import: (assuming you use outlook)

Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.BodyFormat = olFormatRichText
.To = strRecipientList
.SendUsingAccount = strFromField
.cc = strRecipientListCC
.bcc = strRecipientListBCC
.Subject = strSubject
.HTMLBody = strEmailBody

If isPDFNeeded Then
.Attachments.Add (strPathAndFileNametoPDF)
End If
.DeleteAfterSubmit = True 'This would let Outlook send the note without storing it in your sent bin
.Send ' sends immediately
' .Display ' opens email for view
End With
 
That code will be useful on another project I'm working on. For this particular project all my email addresses will be part of a database. What I'm trying to do is get the program to send an email without using Outlook and use a proxy server instead of my ISP (Comcast) because I have over 1000 emails to send.

The data that will make up the email will all be pulled from separate tables of the master database.

Here's what it would look like:

To:
cc:
bcc:
From:
Subject:
Message Body: Will have hard coded text but the rest would be data pulled from a table in the master database.

Then it would need to move onto the next record.

Danita
 

Users who are viewing this thread

Back
Top Bottom