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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automated Emailing clarification

Status
Not open for further replies.

jabrony76

Technical User
Apr 23, 2001
125
US
Hi all,

I have a function that automates emailing of .snp reports through Lotus Notes but I would like to CC more than one person. Please advise how I would do this. I have tried to simply enter two email addresses in the .CopyTo field but Lotus Notes is thinking they are one big address.

Thanks in advance.



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
Dim vSendList As String

vFileName = "G:\Complaint_Database\" & Forms![frm_Complaint_Form]![Complaint #:] & ".snp"

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

vSendList = "EmailAddress@domain.com"

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
.PostedDate = Now()
.MarkUnread = True
.SendTo = vSendList
.CopyTo = "Email2Address@domain.com"
.Subject = "New Complaint # " & vComplaint
Set rtf1 = .CREATERICHTEXTITEM(doc, "Body")
'Import Text
Call rtf1.AppendText("This automated e-mail is to inform you that there has been a New Complaint created. See attached form for further information. " & 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
 
Have you tried to separate the e-mail addresses with a ; or ,? That must work, I used to do that, although my script was slightly different
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top