473,406 Members | 2,451 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

MS Access - Send Email to Query List

I am desperate for some code that works, I had no success with my last posted thread. Instead of showing the code I've used (not working), please post a working code to help me out.

I have a simple contact database, I've queried a list of email newsletter subscribers, I want to insert these email addresses into the BCC field of a new/blank email (default email program). How can I do this?

Thank you in advance of mighty code masters...
Mar 30 '07 #1
4 2481
iburyak
1,017 Expert 512MB
In Visual Basic References check
Microsoft Outlook 11.0 Object Library

Use this code:

[PHP]Dim objOutlook As New Outlook.Application
Dim objMailItem As MailItem
Set objMailItem = objOutlook.CreateItem(olMailItem)
With objMailItem
.bcc = "list of recipients here"
.Subject = "Test"
.Body = "TEST"
.Send
End With[/PHP]

Good Luck.
Mar 30 '07 #2
The problem I'm having in not sending the email, but rather, referencing the email addresses from the database into the bcc field.

Can anybody give me some example code to gather the email addresses from my query into the bcc field of a single blank email.

Thanks
Mar 30 '07 #3
iburyak
1,017 Expert 512MB
You've got an answer to this question here:

http://www.thescripts.com/forum/thread623078.html
Mar 30 '07 #4
iburyak
1,017 Expert 512MB
Your full code should look something like this:

[PHP]Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim rcpts As String

Set db = CurrentDb
Set rst = db.OpenRecordset("EmailInfo Clients")
rcpts = ""

With rst
.MoveFirst
Do Until .EOF
rcpts = rcpts & .Fields("Email_Name") & ";"
.MoveNext
Loop
End With

Dim objOutlook As New Outlook.Application

Dim objMailItem As MailItem

Set objMailItem = objOutlook.CreateItem(olMailItem)

With objMailItem

.bcc = rcpts

.Subject = "Test"

.Body = "TEST"

.Send

End With [/PHP]


Good Luck.
Mar 30 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to...
14
by: Steve Jorgensen | last post by:
I just got paid to solve this problem for one client, so I might be impeding future business opportunities by sharing this secret, but a rising tide floats all boats, so... I've seen this...
3
by: Strasser | last post by:
In Access2000 mass emailing worked perfectly (very powerful tool!). Doesn't work when using XP version of both Access and Outlook, even though I checked the box to ensure that I was sending the...
1
by: jerry.ranch | last post by:
I collect information from my clients with an xls file I import the xls data into my access table. I don't have them put info directly into Access, because, despite the drop downs I have for...
10
by: Mike Charney | last post by:
Is there a simple way to send SMTP email from Access VBA? Mike m charney at dunlap hospital dot org
17
by: rdemyan | last post by:
My app creates a building report. My users have requested that I provide functionality to e-mail these "building reports" to building managers once a month. So assuming that I have the...
2
by: Asril | last post by:
I am attempting to use Access to email a supervisor a list of employee timecards that were not completed on a daily basis. The list of supervisors being emailed can changeday to day along with the...
4
by: JB | last post by:
Hi All, I need to write my first "distributed" application and due to my lack of knowledge and experience in that area, I'm stuck on the first big design decision. Reading a lot on distributed...
1
by: Paul Brady | last post by:
This must be a common operation, but I have searched this newsgroup and have wrestled with the help messages, and I seem to need help with this simple task. I have an Access 2000 database which,...
4
by: zufie | last post by:
I have a main form containing a command SEND button that prompts an email form to pop up. The email address(es) that are supposed to appear on the email form are those corresponding to the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.