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 Replies
ADVERTISEMENT
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
Jul 2, 2014
I'm trying to create a lotus notes email through vba that contains data from one of my access tables. Since I'd like the data to be displayed in a tabular fashion, I'm trying to format the body of the email in html.
View 1 Replies
View Related
Jun 26, 2007
I wish to attach to an email a specified "Shortcut" such that recipients will be able to simply click the "attachment and the Access application will open.
I have searched the forum quite extensively but the perspiration has overtaken the inspiration so any assistance would be appreciated.
Below is the complete code that I am using
Private Sub Combo206_Click()
Maint_Sup_Close = Now()' Update a field
Dim Attachment As String
Dim MailDoc As Object
Dim AttachME As Object
Dim EmbedObj As Object
Dim s As Object
Dim db As Object
Dim doc As Object
Dim rtItem As Object
Dim Server As String, Database As String
Dim strError As String
Dim PI As String
Dim Description As String
Dim Work As String
Dim Email As String
Dim Docket As String
PI = Me.PI_No_1
Description = Me.Desc
Email = Me.Created_Email
Docket = Me.Docket_ID
Work = Me.Work_Required
Set s = CreateObject("Notes.notesSession")
Server = s.GETENVIRONMENTSTRING("MailServer", True)
Database = s.GETENVIRONMENTSTRING("MailFile", True)
Set db = s.GETDATABASE(Server, Database)
On Error GoTo ErrorLogon
'see if user is logged on
Set doc = db.CREATEDOCUMENT
On Error GoTo 0
doc.Form = "Memo"
doc.importance = "1" '(Where 1=Urgent, 2= Normal, 3= FYI)
'Send an e-mail to
doc.SENDTO = Email
doc.RETURNRECEIPT = "1"
doc.Subject = "Maintenance Request Closure"
Set rtItem = doc.CreateRichTextItem("Body")
Call rtItem.APPENDTEXT("Maintenance Request " & Docket & " for " & PI & " " & Description & " This request was created by yourself and has been Completed. Please confirm Completion")
Call rtItem.ADDNEWLINE(1)
Call rtItem.APPENDTEXT("")
Call rtItem.ADDNEWLINE(1)
Call rtItem.ADDNEWLINE(2)
Call rtItem.APPENDTEXT("Request Details were")
Call rtItem.ADDNEWLINE(2)
Call rtItem.ADDNEWLINE(3)
Call rtItem.APPENDTEXT(Work)
Call rtItem.ADDNEWLINE(3)
Works fine down to here
next line gives error 13 Type Mismatch
Set AttachME = doc.CreateRichTextItem.Add("file:\absmanuf_serverabsmanuvMaintManagReposit oryEmail_Cell_Mcs_Maint.mdb.lnk")
SetEmbedObj = AttachME.EmbedObject(1454, "", "\absmanuf_serverabsmanuvMaintManagRepositoryE mail_Cell_Mcs_Maint.mdb.lnk")
doc.SaveMessageOnSend = True
Call doc.Send(False)
Set doc = Nothing
Set db = Nothing
Set s = Nothing
Set rtItem = Nothing
MsgBox "Message Sent"
ErrorLogon:
If Err.Number = 7063 Then
MsgBox " You must first logon to Lotus Notes"
Set doc = Nothing
Set db = Nothing
Set s = Nothing
Set rtItem = Nothing
End If
End Sub
I am a bit out of my depth and would appreciate a guru correcting the error of my ways
Regards
Len
View 3 Replies
View Related
Jul 23, 2015
I have been sending plain text emails for a while, but now I have a project where the formatting of the text needs to be specific and I need to send as rich text.
I can use the rich text from a table, excel, or word, but I am at a loss on how to get the data to Lotus Notes.
View 1 Replies
View Related
Jan 3, 2008
does anyone know what's Simplest way to send an email from Access using Lotus Notes
(no attachment required)
View 10 Replies
View Related
Jul 22, 2005
Does anybody know how I can change the default mail client from Outlook to Lotus notes? I'd like to use the sendObject utility to create a macro which sends data I enter into my form.
Thank you to all ahead of time :rolleyes:
View 2 Replies
View Related
Dec 12, 2006
I want to send an email thru Lotus Notes by clicking on a command button and need some help.
I have a tabular form which displays info from a make-table query. I would like to have a command button next to each record, which when clicked will send an notice(email) to the corresponding email address.
The following are displayed for each record:
View 1 Replies
View Related
May 28, 2015
Reading all mails from a Lotus Notes database, a view, a collection is not that difficult.
What I Need, but no where found is HOW TO Import the actual marked or opened mail, so only ONE mail, the current mail.
View 3 Replies
View Related
Sep 10, 2013
I have a VBA code to import mail from Lotus Notes into Access. The database user is able to read his email inside Access, similar to any email program.
Unfortunately, when I use the GetItemValue (lotusscript) method to read the body of the email message, Notes will render the Rich Text information as Plain Text, and I end up with no formatting information (bold letters, underline, text color, etc.)
How to import messages from Notes to Access and keep the text formatting? I am storing the data in a Rich Text Memo field in a table. I have found code to write HTML (MIME) messages, but not to import them into Access.
View 2 Replies
View Related
Jan 23, 2013
I need to create an email with an Access report attached as a PDF. I am using Access 2007 and Lotus Notes.If I use SendObject with acSendReport and acFormatPDF, it opens an email just fine but the attachment is created with some random letters and numbers and .tmp as the file name.
If I use Adobe Reader to open the attachment it displays correctly as a PDF, but I need the attachment name to be .pdf so it will automatically open with Adobe for the users.Is there a way to accomplish this with Lotus Notes? I have searched this forum and found some options for Outlook users, but not for Lotus Notes.
View 2 Replies
View Related
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 5 Replies
View Related
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
Nov 4, 2005
Noob needs guidance.
I've worked with Access before but I've never had to setup mass mailing using Lotus Notes retrieving the data from Access.
I'm basically working with Access 2003 with a database containing all the clients information with email and personalised messages and it needs to be sent out through Lotus Notes R5 Release 5.0.11
I've done searches on this site and I've found many codes but I was wondering if there was a beginner's guide to this.
If anyone has links to where I can read up on it that would be great too.
Your help is much appreciated. Thanks in advance for your help.
View 3 Replies
View Related
Jun 14, 2007
Hi all,
I have a list box which has several columns. What i'm trying to do is have a button that when clicked takes the values of the selected list box item and put them into a new lotus notes email. It doesn't need the address or any other detail, just the info into a new mail. I have seen some post's here but not sure i understand them (bit of a noob to access/vba).
Is this possible to do and can someone please point me in the right direction?
Thanks,
Spinkung.
View 3 Replies
View Related
Sep 16, 2014
the user opens a certain mail and THIS mail should be either saved as PDF (for example by CutePDF - as it works with a word-doc) to disk or be imported to my Access datebase in a certain field (the Body of the mail).
But I could not find code to catch just the OPENED Mail, there are a lot of examples how to loop through a Folder or a view reading all mails in it, but no one for just the ONE.
There should be something like "uidoc", but I cannot manage it.
So in real, my problem will be to "detect" the opened (or at least the marked) mail in the Notes GUI. In Outlook I do this with ActiveInspector.CurrentItem, but in Notes?
View 1 Replies
View Related
Jan 15, 2015
I am looking to see if i could possibly get code that would allow me to send a calendar invite from Access to Lotus Notes?
View 2 Replies
View Related
Aug 28, 2014
I am looping through a Lotus Notes view through mails which comes with standardized content from our homepage.Some of them have one or more attachments, some mails do not have attachments. I loop through the view, read the content, write the content in a table, extract all the attachments (if there are some) and remove the mail from view this into another view.
The loops runs through without error, but is skips the mails without attachments, so that after the "first loop" all mails without attachments remain in the view, whereas all with attachments have been processed accordingly.With another start of the function all the mails WITHOUT attachments are processed accordingly as well.This is not logic for me, as all code I found on the web looks like this:
Do While Not LNDoc Is Nothing
Set NxtDoc = LNView.GetNextDocument(LNDoc)
'check if Attachments are in the mail !!!!!!
If LNDoc.HasEmbedded Then <----
[code]...
View 6 Replies
View Related
Oct 13, 2013
I receive mails through LN and loop through a certain folder, reading DeliveredDate, Body, Subject and writing those items into an Access-table.This works fine, before I go for the loop I put the doc in another folder and remove the current doc from the folder.
Call LNDoc.PutInFolder("SMSBackup", False)
Call LNDoc.RemoveFromFolder("SMSResponse")
Set LNDoc = LNView.GetNextDocument(LNDoc)
Loop
Without any error, without anything abnormal in the mails the code exits after a few loops, sometime after more or sometime after less read mails.The problem ist the RemoveFromFolder, not the PutInFolder function.
So to avoid this behavoir, I changed my code to finish the loop without
Call LNDoc.PutInFolder("SMSBackup", False)
Call LNDoc.RemoveFromFolder("SMSResponse")
and added after the loop a NotesCollection which should do ALL at once.But this part of the code does nothing at all (allthough found on the web).
With LNCollection
.PutAllInFolder "SMSBackup", False
.RemoveAllFromFolder "SMSResponse"
End With
The complete code looks like this:
Set objNotes = GetObject("", "Notes.NotesSession")
Set LNdb = objNotes.GetDatabase("myServer", "MyNSF")
If Not LNdb.IsOpen Then LNdb.OpenDatabase
If Not (LNdb Is Nothing) Then
Set LNView = LNdb.GetView("SMSResponse")
[code]....
View 1 Replies
View Related
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
Jul 31, 2013
What is the best way to send a single email to multiple recipients?
View 14 Replies
View Related
Dec 18, 2007
Hi,
I'm not sure which Form topic this post should go under ...
I have an Access Database which contains contact information including email addresses in a number of tables. Each table is a reference group of individuals interested in a particular topic and has three fields (contactID, name and Email). All tables relate back to a master address list.
This allows me to have different (or multiple) people from within the same master address as contact persons for different reference groups. When I am doing labels, or printed reports for labelling I simply combine the address from the master list with the conact from the reference group list.
I would like to be able to replicate this approach for e-mail messages.
Ideally the databse would create distribution lists and export these to outlook global address list where they would be available to all users.
Alternately, I would write a module that automatically generates a new email message with all the Email Address entries from a user selected table in the To: field. The user would then edit the email message and press send.
It seems to me that eitehr way I will need to somehow concatenate all emails addresses in a table into a list separated by semi-colons.
View 1 Replies
View Related
Oct 25, 2007
Can anyone help me send an email with an attachment from within Access using Lotus Notes as the mail client?
Huge round of drinks to anyone who can crack this for me!!
bottoms up!
View 1 Replies
View Related
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
Aug 24, 2005
Hi guys, here is my problem.
I am sending emails when the user press a button, but the problem is:
1 - How to check is LNotes is open
2- How to know if the user needs to enter the password.
With the following code an email is sent ONLY if notes is open AND the psw is not required.
Public Sub Sendmailf(Task As String)
Dim nSession As Object
Dim CurrentUser As String
Dim DataBaseName As String
Dim nDatabase As Object
Dim nMailDoc As Object
Dim nSendTo(60) As String 'array for 60 e-mail address
Dim EmbeddedObj As Object
Set nSession = CreateObject("Notes.NotesSession")
CurrentUser = nSession.username
DataBaseName = Left$(CurrentUser, 1) & Right$(CurrentUser, _
(Len(CurrentUser) - InStr(1, CurrentUser, " "))) & ".nsf"
Set nDatabase = nSession.GETDATABASE("", DataBaseName)
Call nDatabase.OPENMAIL
Set nMailDoc = nDatabase.CREATEDOCUMENT
With nMailDoc
nSendTo(0) = vemail
.Form = "Memo"
.Body = Chr(13) & Chr(13) & Chr(13) & Chr(13) & _
"Status: " & Me.status & Chr(13) & _
"Creation Date: " & Me.Open_dt & Chr(13) & _
"Effective Date: " & Me.effective_dt & Chr(13) & _
"Completion Date: " & Me.completion_dt & Chr(13) & _
"Requester: " & vreq & Chr(13) & _
"Actioned By: " & Me.Assignee & Chr(13) & _
"Description: " & Chr(13) & Me.description & Chr(13) & _
Chr(13) & Chr(13) & Chr(13) & Chr(13) & _
Chr(13) & Chr(13) & Chr(13) & Chr(13) & _
"Validation Signature: ................................." & vreq
.sendto = nSendTo
.Subject = "Task: " & Task_Num & " is Ready to be Validated"
.Importance = "0"
.SEND (False)
End With
Set nDatabase = Nothing
Set nMailDoc = Nothing
Set nSession = Nothing
Set EmbeddedObj = Nothing
End Sub
thx for your help
View 5 Replies
View Related
Oct 25, 2005
hi,
i'm using access 2000 to create an application. i need to get the information of Staff, but the Staff informationis in Lotus Notes 6.
my problem is how to link table from Lotus notes document?
an for your information exporting from Lotus Notes then access 2000 link table to that exported file is not an option.
anyone help?
regards,
askaccess :confused:
View 2 Replies
View Related