Modules & VBA :: Add CC Email Addresses Into Automated Email?
Aug 3, 2015
I have an automated email system (Lotus Notes) in a Access database I have created and am looking for the code needed to add up to 3 c.c addresses into an email prior to sending automatically.
The code I have to send the email to the To: individual is all working but what code I need to add and where for the c.c addresses of which there could be 1, 2 or 3. The control for To address is EmailTo = CustCopyEmail The controls for the 3 c.c emails are cc_EmailAddress, cc_EmailAddress1 and cc_EmailAddress2.
Here's the code I have:
Private Sub SEND_CC_Click()
' Set up the objects required for Automation into Lotus Notes.
Dim Maildb As Object 'The mail database.
Dim Session As Object 'The Lotus Notes session.
Dim MailDoc As Object 'The mail document itself.
Dim UserName As String 'The current users Lotus Notes name.
I have made a query with the name "Confirmation" and it is setup like this:
Name trainee Email Training John John@mail.com Tr one Mary Mary@mail.com Tr two
I also made a button in a report with the title "Send Mail" now is my goal that if i press that button automatically multiple e-mail message's will be generated with data from people in that query. So if click on that "Send Email" button i want two different mails messages generated that will be send to John@mail.com and Mary@mail.com with in the mail body their data.
I have a query (Access 2007) that contains a field named "email" (which contains email addresses, of course). I want to email everyone in the query and they are all going to receive the same message. My email to them doesn't have to be personalized and I don't need to collect data from the recipients. I don't even need a reply to the email I send.
I have a database that I can use to create a query, grouping companies by city. I then want to send a specific email I have created in outlook to all of the email addresses in the query.I do not need to include names.
I am trying to populate multiple email addresses based on a table and a yes/no check box. If the checkbox is checked, they receive an email. I have a table with Employee/email combobox with the second column being the email address, and a checkbox.
I am trying to loop through a query results to extract email addresses from a query result.
I have the following code
NameCriteria = Forms![MainMenu]![tbl_Course_Details]![Course_Name].Value DateCriteria = Forms![MainMenu]![tbl_Course_Details]![Course Date].Value Dim db As DAO.Database Dim rs As DAO.Recordset Dim sqlStr As String
[Code] .....
If i run this in access as a query then it returns results but when i run in there then it says no current Record and i cant work out why?
Someone on another post said that sql uses US date format so i tried converting to us date and still no results?
I have set up a process to automatically email reports from MS Access 2006. Everything would would perfectly except that when the process runs, a messagbox pops up stating that 'an unknown prgram is trying to send an email on your behalf'. Before the email is sent you have to click on the button to allow sending. I need this program to run very early in the morning when no one is around to click the button.
I have tried several things to get a round this by digitally signing my Access project and setting up certificates in outlook but nothing has worked.
Is there any way around this without lowering my security level, my antivirus or antispyware software?
Simple query from an amateur. I have a list of people in a table, each with thier email address. How can I convert this into a list of addresses to paste into a group email? (Ideally with ";" as a separator between addresses)
Is it possible to send e-mails to all of your e-mail addresses in one single e-mail?
Right now I am able to open up an individual e-mails for each of my stored e-mailo adresses but it would be so much better (and more user friendly) if I could just have one e-mail with all addresses in the To: field.
Hi I have a large file where I am trying to clean up the data. One of the fields is the email address. I want to check if the email address has something followed by an @ symbol followed by something else. If it does not, then I want to replace it with a null value. Can you help? I thought that I could use the wildcard features such as <>*@* but this does not appear to be working. Noel
Every month I have to make a report about registration of hours of a group of employees. (These employees have a deal with direction about travel hours vs. working hours).This report has to be send to the group members but only the data which is valid for the group member in it. There are 11 persons in this group so I have to send 11 reports.
I made a query with the hours registered from this group. I couldn't export it because it was read-only. That was because the query contains joins to the employee table. After that I tried it with a report. That nearly went well but it contained all data and not the seperated info.What I need to know:What is easier/better: use a query or use a report?Is there code which looks in my query or the report and makes it into seperated reports?I've tried the code of Tony Hine but I can't make it work.After that I need to do a mail-merge. But first of all do I need to make the seperated reports to work.
I am a relative newcomer to Access, and am trying to work out if there is a way to isolate email addresses in a line of text, and delete all the text around them.
I have basically got a column which contains blocks of text and I want to extract the email addresses that are embedded within them. Does anyone know if this is possible by running queries?
Im using the code below to send information by email. BUT:
I want to send the same information to more than one recipient. can i write more than one address in the SendObject?
What can i do if i do not know prior to sending how many addresses i want to include. (this means that once i might have tosend it to 1, then later to 3, etc...)?
The code is:
Private Sub cmdMailTicket_Click() On Error GoTo Err_cmdMailTicket_Click
Dim stWhere As String '-- Criteria for DLookup Dim varTo As Variant '-- Address for SendObject Dim stText As String '-- E-mail text Dim RecDate As Variant '-- Rec date for e-mail text Dim stSubject As String '-- Subject line of e-mail Dim stTicketID As String '-- The ticket ID from form Dim stWho As String '-- Reference to tblUsers Dim stHelpDesk As String '-- Person who assigned ticket Dim strSQL As String '-- Create SQL update statement Dim errLoop As Error
'-- Combo of names to assign ticket to stWho = Me.cboAssignee stWhere = "tblUsers.strUserID = " & "'" & stWho & "'" '-- Looks up email address from TblUsers varTo = DLookup("[strEMail]", "tblUsers", stWhere)
stText = "You have been assigned a new ticket." & Chr$(13) & Chr$(13) & _ "Ticket number: " & stTicketID & Chr$(13) & _ "This ticket has been assigned to you by: " & strHelpDesk & Chr$(13) & _ "Received Date: " & RecDate & Chr$(13) & Chr$(13) & _ "This is an automated message. Please do not respond to this e-mail."
'Write the e-mail content for sending to assignee DoCmd.SendObject , , acFormatTXT, varTo, , , stSubject, stText, -1
'Set the update statement to disable command button 'once e-mail is sent strSQL = "UPDATE tblHelpDeskTickets SET tblHelpDeskTickets.ysnTicketAssigned = -1 " & _ "Where tblHelpDeskTickets.lngTicketID = " & Me.txtTicketID & ";"
On Error GoTo Err_Execute CurrentDb.Execute strSQL, dbFailOnError On Error GoTo 0
'Requery checkbox to show checked 'after update statement has ran 'and disable send mail command button Me.chkTicketAssigned.Requery Me.chkTicketAssigned.SetFocus Me.cmdMailTicket.Enabled = False
Exit Sub
Err_Execute:
' Notify user of any errors that result from ' executing the query. If DBEngine.Errors.Count > 0 Then For Each errLoop In DBEngine.Errors MsgBox "Error number: " & errLoop.Number & vbCr & _ errLoop.Description Next errLoop End If
In my database for our charity there is a field for email addresses. Most of the contacts have a single email address and we can send them their individual reports without any problem. However a number of the contacts have 2 email addresses and these are stored in the email address field with a semicolon between the 2 addresses. However the system can't send emails to these contacts! Are we storing the addresses in the wrong way? Or is there some reason why Outlook won't regard the 2 addresses as separate email addresses - does it think that it is one strange email address that it doesn't recognise?
I have a form which has a button to email the data out in a standard email message.
Private Sub Command60_Click() Dim MyDb As dao.Database Dim rsEmail As dao.Recordset Dim sToName As String Dim sSubject As String Dim sMessageBody As String
[code]...
This works well enough, however, FIELDS 11 through to 16 contain the venue address. This is all we ll and good if every field of the venue address is populated. here are times when not all of the fields are populated, for instance, the address might only be 5 lines.I know I can do this using IIf statements on a report, but how can i achieve the same thing for the email.
How can I send an automated email notification everytime a new record is created. I have a macro set up with the send object completed, I just can't figure out how to tweak the logic so it will do it everytime a new record is created.
I am currently using vb code to send an email in Access on the click of a button. I want the database user to be able to enter the recipient in a text box [ToEmail] which is on form [GroupStockProfiler]. However, I'm unsure how to put this into my code. I currently have the following which doesn't work (unless I put a specific email after 'To'):
I have a parameter set on the query at run which filters by Region i.e. the box pops up and they enter a criteria..I would like to have a field entered next to Email that would take all the Email Addresses in my query result and concatenate them so essentially I have an email list I can pop in Outlook.
Or alternatively, a solution to allow access to these email lists via a button on a form. It has to be something very simple for an end user to access. For instance right now, to get there list they hit a button to run the query then enter the parameter then if desired, hit another button to export to excel. Today, they use Excel for everything and are used to having the concatenated email addresses in one cell in excel. For this reason, I am trying to have the email addresses concatenated in the query results to mimic what they are used to today. But I am not sold on it if there is a better way that is easy for them.
I have a query that may have 6 - 7 different records for example each record contains a different email address, i need to get the first email then send and email to that address then go to the next record get that email address send an email to that email address until its gone through all the records...
I use this code to send an email, dont know how to loop through records and get the email...
Code: Dim appOutLook As Outlook.Application Dim MailOutLook As Outlook.MailItem Dim strPath As String Dim strFileName As String Set appOutLook = CreateObject("Outlook.Application")
I need to let all our suppliers know we have moved and wanted to do this by email. how I use Access database of suppliers email addresses and use them on Outlook.