Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automated Lotus Notes Report Mailing CC: ? 1

Status
Not open for further replies.

jabrony76

Technical User
Apr 23, 2001
125
US
Hi all,

I have a module which creates a .snp in a pre-defined location and emails that file through our Lotus Notes email system. We are using Lotus Notes v4.5 and Access 2000 on Windows 2000 machines. Code is attached below in red

I have three questions:

1. I'm having difficulty getting it to send the email to more than one person. The code was borrowed from this forum and I was wondering if anyone had any insight how to CC: someone on the email. In the borrowed code there is a field for "CC:" but when I place someones name there, the email does not get CC'ed to that person.

2. The code saves the document as a draft in the senders email account, can I switch this to be saved in the "sent" folder.

3. When the email arrives at the destination inbox, it is marked read already, can I have it marked unread?

Thanks!
Andy


[red]

Public Function EmailUsers()

Dim session As Object
Dim db As Object
Dim doc As Object
Dim rtf1 As Object
Dim eo1 As Object
Dim vComplaint As String
Dim vFileName As String

vFileName = "S:\Complaint Database\ComplaintFiles\" & Forms![frm_Complaint_Form]![Complaint #:] & ".snp"

vComplaint = Forms![frm_Complaint_Form]![Complaint #:]

DoCmd.Hourglass True

'Start new Lotus Notes Session
Set session = CreateObject("Notes.NotesSession")
Set db = session.GETDATABASE("", "")
'Open Mail Database. This will prompt for a password if not already open-
'For full automation, Notes should already be open.
Call db.OPENMAIL
'Make new document
Set doc = db.CREATEDOCUMENT

'Build e-mail
With doc
.Form = "Memo"
.SAVEMESSAGEONSEND = True
.SendTo = vSendList
.cc = "Andrew J Michalski/IL/Unitedmail@Unitedmail"
.Subject = "New Complaint # " & vComplaint
Set rtf1 = .CREATERICHTEXTITEM(doc, "Body")
'Import Text
Call rtf1.AppendText("New Complaint Created. See attached form for further information. " & Variable & vbCrLf & vbCrLf)
'Attach Files
Set eo1 = rtf1.EMBEDOBJECT(1454, "", vFileName)
'Send Mail
Call .SEND(True)
MsgBox "An Email has been sent to QI and Support Staff informing them of this complaint. Thank you.", vbInformation, "Confirmation"
DoCmd.Hourglass False

End With
'Deallocate Objects
Set rtf1 = Nothing
Set doc = Nothing
Set session = Nothing
End Function

 
First of all, try this link: it's the IBM RedBook on the LoNo 4.5 object & is the only thing I know to check out available properties & methods for LoNo objects:

Q 1 - try using
Code:
CopyTo
rather than
Code:
CC
as property

Q 2- if the
Code:
SaveMessageOnSend
option = set to true, this should save the email in your SentItems folder but you also need to set the
Code:
PostedDate
property to Now()

Q 3 - dunno. The LoNo mailer I wrote (one for 4.5 and one for 5.0.8) both are received marked "unread" by the users. You could try the
Code:
MarkUnread
method.

Hope this helps, anyway

Cheers
Nikki
 
Nikki - Thanks for the tips, they all worked perfectly!! Andy
 
To send the mail to more than 1 person, you could create a group in lotus notes. Eg Create a group in your address book, and add all the necessary contacts to the group.
Instead of sending ht email to a person, send it to a group. This will work, I have done it in Access 2000 usinf Notes v5.03 and v5.08.

Alternatively, use a for and next statement, or another loop to send the mail one after another.

savemessageonsend=true should work.



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top