Modules & VBA :: Selecting Recipients From A Table For Sending Emails? Access 2007

Jul 19, 2013

In an Access 2007 module, is there a way of sending an email to a list of people stored as a list in a table in the database, rather than having to put all the names into the function?

I have a function I'm using to generate and send out an email to certain people, but the list is constantly growing so I'm looking for a better way to manage it! The main issue is having to kick users out of the database every time I need to update the recipients list... because it's stored in the code.

If I create a simple table containing all the names, how could I then ask it to use that instead?

This is the function I'm using currently - found on here and adapted to my own purposes

Syntax to use for the function: SendNotesMail "recipients", "Body Message", "Additional Text", "Subject"

Code:
Public Function SendNotesMail(strSendTo As String, strBody As String, strExtraText As String, strSubject As String)
'This public sub will send a mail and attachment if neccessary to the recipient including the body text and additional comments from the Active record
DoCmd.OutputTo acOutputReport, "REP09emailnotification", acFormatRTF, "x: endersgroup tendering databaseTenderUpdate.rtf", False
Dim Subject As String
Dim Attachment As String

[Code] ....

So I guess my question is: how do I get my recipients from a table into the strsendto?

View Replies


ADVERTISEMENT

Modules & VBA :: Using Array To Specify Email Recipients (Access 2007 - Lotus Notes)

Aug 7, 2013

I've got a form which emails out a report when a new record is added to my database but I'm stuck when it comes to making it send it to more than one recipient.

I came across this on the web... which suggests I should be using an array but I don't know anything about arrays.

For multiple email addresses you just set MailDoc.sendto to an array of variants each of which will receive the message. So

Code:

Dim recip(25) as variant
recip(0) = "emailaddress1"
recip(1) = "emailaddress2" e.t.c

maildoc.sendto = recip

My problem is I'm not sure how to implement it? My 'recipients' are being pulled from a query... how do I get that into the array of variants?

View 11 Replies View Related

Modules & VBA :: Send Emails To Defined Array Of Recipients Using CDO

Sep 18, 2013

I am trying to send emails using CDO to an array of recipients loaded from a query. I have made this work using Lotus Notes so i know the first part of my code is correct, and the current code I have works when I input an actual email address. But when I try to add the Array name into the 'To' field I get a data mismatch error.

View 3 Replies View Related

Modules & VBA :: Sending Email With Access 2007

Mar 12, 2014

How would I set up an Outlook email using a list of recipients from an Access table? I'd like to be able to run this from Access 2007 and not Outlook. However, once the email is set up, I'd like to be able to go into the email and add subject, body, etc. before sending the email.

View 5 Replies View Related

Sending Emails From Access

May 4, 2006

Hey

I have created a database system to book appointments between tutors and students in a school.

In the form, I want tutors to be able to send appointment details to students via email. I have created tables consisting of these details, however I don't know how to set it up for emails to be sent.

I am finding this very difficult especially with the visual basic codes. :confused:

Please help!

Thanks

ssslick x:)

View 3 Replies View Related

Sending Emails From Access

May 30, 2005

Hi,
I have sent up a system were i email a table from access using the .sendobject function.

This all works fine. The problem i have is i need to attacted to emails to the same email. Any idea's how this can be achieved.

Thanks

View 2 Replies View Related

Modules & VBA :: Run Time Error 287 When Sending Emails

Dec 20, 2013

I have the following code in a module that sends out various email updates to me when I'm off site. On my PC it works perfectly whether I have Outlook open or not. I've installed the database on several other machines, but I'm getting a Run Rime Error 287 on the .Send line if the user has Outlook closed. Any setting somewhere in Outlook or Access that needs changing? Or is there something that can be changed in the code to ensure the email sends whether Outlook is open or not?

Code:
Public Sub SendEmailNotification(strSubject as String, strMessage as String, strAddress as String)
Dim olEmailApp As Object
Dim olMsg As Object
Dim strEmailBody As String
Set olEmailApp = CreateObject("Outlook.Application")
Set olMsg = olEmailApp.CreateItem(0)

[Code] ....

View 1 Replies View Related

Modules & VBA :: Sending Multiple Emails Using Outlook

May 7, 2015

Using Access 2010; I have code that generates multiple emails to send using outlook. It works fine except that all emails go to my draft folder and I have to go the outlook and send them individually. This is fine when I have under 10 emails; but sometime it can get up to 50 or even 100 emails. What I have to do to send them from my draft all at once. The emails go to draft to inspect for errors.

View 1 Replies View Related

Sending Emails From Access Database

Jan 26, 2012

Recently created a database with a form that the user provides problematic information. The form has a close button that has a macro attached that initated an emails and send the form information in a report to the end user . My problem is the function works great when the sender has a Outlook account. When the sender has a gmail account - the command will not work. I read that VBA can be written but I am not able to write SQL.My level with access is using built in functions and commands.

View 3 Replies View Related

Modules & VBA :: Sending Emails To Multiple People Based On Same Query And Report

Jul 15, 2013

At present I have a tblData, a tblPeople, a long union query and a report that displays its results. On a form I select a person from tblPeople (another field on that table contains their email address), run the query and report in that person's respect and email the results to them.

What I want to do is add a button which runs some VBA code which cycles through tblPeople, runs the query for each person, works out if the query has returned any records from tblData for that person, and if so - sends them the report.

I am using Access 2010

View 4 Replies View Related

ACCESS 2007 Save Emails

Dec 22, 2007

Hello,

I am building a databse that registers all communication between a company and a customer. here is my question.
If customer A sends an email to the company how can I store that email in my database. I dont want to copy and paste the contents of the email to a memo field.
Is there a way to automate this?

View 2 Replies View Related

Sending Group Email To Selected Recipients

Aug 3, 2005

OK

I have read through I think every post with the word email in the title ! and in the subject... and tried various bits of code that were posted, but can't get anything to work... :mad:

Here is what I want to do.

I have a form (based on a qry called "QryInvoices Due") which brings up a list of people.

On this form is a field called "send email?" which is a tick box which the user can select.

I also have a command button ! which When Clicked I want it to do the following.

Send an email to all of the recipients which have "send email?" as YES

their email addr is in a field called "Contact email"

I don't want the email as an attachment, I don't need the message or even the subject included (although wld be nice as will be fairly static i think :) )

All I want is it to bring me up the Outlook New Message with all the recipients in it, I can add the subject and message then if necessary. Oh and there's more !! ;) I need the recipients to be in the bcc field as I don't want them all to see each other, the to: field can be blank or the first recipient whatever.

Anybody got any code that I can just copy and paste !! and that will miracleously work (sp?) ... Hope u can follow what I;m looking for..

Many thanks in advance

D

View 1 Replies View Related

Reports :: Sending Multiple Email - Unknown Message Recipients

Oct 15, 2013

I have this code below its giving me the RUntime 2295 error. Unknown message recipients. I have check all email addresses and they are fine. Everything else works except when it gets to Outlook and do not send email. I did a Debug Print but didnt understand how to do it.

Private Sub Command9_Click()
Dim rst As DAO.Recordset
Dim strEmailAddress
Set rst = CurrentDb.OpenRecordset("T_Inspectors")
Do Until rst.EOF

[Code] ....

View 2 Replies View Related

Modules & VBA :: Sending A Report From 2007 Via Lotus Notes

Jul 24, 2013

I have a function which generates a report as a RTF file, then sends it out to a list of users via Lotus Notes. The list of users is generated within the function using a query. The code worked fine while I was testing with just me in the recipients... but as soon as I add more people to the list, I get Runtime error 7294: Unable to send mail, no match found in name and address book(s) If I copy and paste the generated list into a new mail message in Lotus Notes, it accepts them all....

I THINK this is because when it's sending from Access, it's trying to use my personal address book, rather than the one that's held on the mail server... Does that sound plausible / feasible? If it does, how to change this?

I tried changing the recipients list to have the 'actual' email addresses in it rather than their names - when I did that I got no errors... but it didn't send the email, either!

View 10 Replies View Related

Sending Emails Without Interruptions

Mar 9, 2015

I am using a form to send an email but part way in the process a message box pops up with 2 buttons labeled: Allow and Deny with some other information. I am forced to select allow in order for the send process to be completed.

Is there a way to prevent this popup so that the process completes smoothly without interruptions?

View 14 Replies View Related

Sending Customized Emails On Update

Jan 19, 2012

I have designed an Access database with a certain table called EmailAlerts.

This table has two fields: EmailMessage and Recipients.

The EmailMessage field stores the body of the mail to be sent to the corresponding email addresses in Recipients. E.g.:

EmailMessage | Recepients
Hello | abc@xyz.com
Goodbye | pqr@xyz.com

Now what I want to do is, whenever a record is added to this table, I want to send the email to the corresponding recipient. How can I do this?

View 5 Replies View Related

Sending Emails, Code Halts If Invalid Email Address

Nov 7, 2007

I'm using CDOSYS and SMTP in a vb function to send emails via Ms Access 2003.

My code loops through a recordset an sends an email to the email address in the table.

However, all works fine until an invalid email address is encountered, at which point I get an 'Invalid address' error message and the code halts (obviously). BUT, if use 'On Error Resume Next' I get no error message but all consequtive emails are NOT sent.

How can I get the code to ignore the invalid email and carry on sending emails throughout the recordset?

View 7 Replies View Related

Modules & VBA :: Access 2007 / Code For Bulk Importing TXT File Into Separate Records Same Table?

Jul 9, 2014

I have 12,000 cvs that i need to get into An access database so i can start to extract email info etc. They are stored in one folder All Cvs under each of their names edc.txt (i have converted them to .txt) i want to create one table with two fields name (taken from the cv filename and contents (taken fromthe contents of the .txt file). I am using Access 2007.

View 2 Replies View Related

Modules & VBA :: Create Emails And Manage Replies In Access 2010

Jan 25, 2015

I found the below link that looks great and works.

[URL] ....

Te only thing is that I don't have much control over it and would like to build something similar as we also need to work with access 2003 (still )Any way to find how the code works (if there is some of it hidden in access)?

View 6 Replies View Related

Modules & VBA :: Auto Create Emails In Outlook Based On Data In Access?

Apr 20, 2015

I have a table called Contacts in Access:

ID Email
001 email1
002 email2
003 email3
004 email4
008 email5
010 email6

And I have a table called Data in Access:

ID Date Person Title Yes/No Action
001 20/4 Mr A Consultant
001 20/4 Mr B Supervisor
001 20/4 Mr C Consultant
004 20/4 Mr D Consultant
010 20/4 Mr E Consultant
010 20/4 Mr F Supervisor

What I'm looking for is coding that would start with the first ID number in CONTACTS and see if there is the corresponding ID in DATA. If there is, then I want it to create an Outlook email and have:

1.To field populated with the email address in the CONTACTS table

2.From and CC fields to be my email address

3.The subject line needs to read [ID] "Request" and then today's date backward (e.g. 20150420).

4.The body I need to put some generic wording and then a table with the records from the DATA table (first 5 fields plus the headings).

5. The format of the table etc isn't important as long as it is a table format

If it's created the email I want it to go back to the DATA table and put "Email Created" in the Action column for those IDs.

I don't want the email to automatically send; I only want it to create a draft (as this data needs to be manually confirmed before sending).

If for example it gets to checking in DATA table for ID 002 (and as seen there's none there), I want it to skip creating the email and move on to the next ID.

In the end I would expect to see 3 draft emails open in Outlook ready to be sent, looking something like the below (just 001 below)?

From... my email
To... Email1
CC... my email
Subject: 001 Request 20150420

action the below:

ID Date Person Title Yes/No
001 20/4 Mr A Consultant
001 20/4 Mr B Supervisor
001 20/4 Mr C Consultant

And the DATA table look like this (if only 001 email was created):

ID Date Person Title Yes/No Action
001 20/4 Mr A Consultant Email created
001 20/4 Mr B Supervisor Email created
001 20/4 Mr C Consultant Email created
004 20/4 Mr D Consultant
010 20/4 Mr E Consultant
010 20/4 Mr F Supervisor

I will need to add more data to the CONTACTS table over time, also the DATA table will be different each day so I need the coding to accomodate for both of these possibilities.

View 9 Replies View Related

Modules & VBA :: Sending Email From MS Access 2010

Oct 1, 2013

I would like to update the following code I have been using to send emails, from Access 2010 via Outlook 2010, to include my signature block with hard returns in between each line and a few above the signature.

Lets say the signature would be:
My Name
My Company Name
My phone number
My Reference

I tried next to: stMessage = Me![EmailMessage] &"My Name" & Chr(10) & Chr(13) & "My Company Name"

etc.

It does not work..

Here is the coding :

Code:
Private Sub SendEmail_Click()
On Error GoTo ProcErr
Dim stLinkCriteria As String

[Code]....

View 5 Replies View Related

Modules & VBA :: Sending Digital Secure Email In Access

Sep 4, 2013

I have a question about sending secure emails by VBA code in MS-Access. I have a Access application within you also can also send emails by VBA code using outlook. Everything works fine, but now the recipient wants to receive the mails with a digital signature by S/MIME.

I got a digital certificate from the recipient as a pfx-file.

Is this possible in Access using outlook ?

I use MS-Access 2010 en Windows 7

View 3 Replies View Related

Modules & VBA :: How To Send Different Attachments To Different Recipients

Jul 22, 2015

I currently have a code set up which sends an attachment from a drive on my computer to all the email addresses in a certain query. I would like to change the code so that I can add a button that will allow me to send an email with a specific attachment depending on their individual code in a table, e.g each person will receive a specific attachment. At the moment, the attachments are saved with the same file name as the person's specific code.The code I am currently using is:

Private Sub Command9_Click()
Dim MyDb As DAO.Database
Dim rsEmail As DAO.Recordset
Dim qdf As DAO.QueryDef
Dim prm As DAO.Parameter
Dim strEmail As String
Dim strMsg As String
Dim oLook As Object

[code].....

View 9 Replies View Related

Modules & VBA :: Add Multiple Recipients To Email Code?

Sep 18, 2013

How do I add multiple recipients to the '.To' line in the code below?

Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.BodyFormat = olFormatRichText
If Me.txtDepartment = "IT" Then
.To = "my email"
End If
.Subject = "hi"
.HTMLBody = "hi"
.send
End With

View 3 Replies View Related

Modules & VBA :: Send Single Email To Multiple Recipients?

Jul 31, 2013

What is the best way to send a single email to multiple recipients?

View 14 Replies View Related

Tables :: Access 2003 Table Data Import Into Access 2007 Table

Apr 26, 2015

i have a database in access 2003 when i open it with access 2003 it shows data in table but when i open same table in access 2007 it shows only header rows , no data

how can i see this data into access 2007 or excel 2007.i want to link these table data with excel 2007 or access 2007 but with above problem i can't do it

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved