dbTalk Databases Forums  

Re: multiple copies (or bccs) in Notes from VBA

comp.database.ms-access comp.database.ms-access


Discuss Re: multiple copies (or bccs) in Notes from VBA in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Carl
 
Posts: n/a

Default Re: multiple copies (or bccs) in Notes from VBA - 07-06-2003 , 08:59 AM






Hi John, Ok, I worked on this for ages with a version that I was
doing. And after much deliberation it turned out to be quite simple.
All you have to do is set-up a mailing list in your Notes name and
address book, and then put the name of that mailing group in the below
module and hey presto it will send the report to everyone on your
list.

Cheers

Carl.



john_szakiel (AT) medibank (DOT) com.au (HCP) wrote in message news:<8fface61.0306161448.5e7b1fce (AT) posting (DOT) google.com>...
Quote:
Using the code below to send emails from VBA

my difficulty is that when there are multiple copies to be sent and I
pass the addresses through as follows

bCopyMail = "email_1 (AT) domain (DOT) com.au, email_2 (AT) domain (DOT) com.au"

Notes tries to send copy email (and FAILS) to
email_1%domain.com.au,_email_2 (AT) domain (DOT) com.au


Any clues??



Sub SendNotesMail(repType As String, AttHTML As String, AttTXT As
String, AttXLS As String, ebody As String, email As String, copyMail
As String, bCopyMail As String, PN As String, mailType As Long)

'Set up the objects required for Automation into lotus notes
Dim MailDB As Object 'The mail database
Dim UserName As String 'The current users notes name
Dim MailDbName As String 'The current users notes mail database
name
Dim MailDoc As Object 'The mail document itself
Dim AttachME As Object 'The attachment richtextfile object
Dim Session As Object 'The notes session
Dim EmbedObj As Object 'The embedded object (Attachment)
Dim Subject As String, Recipient As String
Dim BodyText As String, SaveIt As Boolean
Dim mBody As String
Dim attn As String

'Start a session to notes
Set Session = CreateObject("Notes.NotesSession")
UserName = Session.UserName
MailDbName = Left$(UserName, 1) & Right$(UserName, (Len(UserName)
- InStr(1, UserName, " "))) & ".nsf"

'Open the mail database in notes
Set MailDB = Session.GETDATABASE("SHQVIC/SERVERS/MPL",
"mail\HCP.nsf")
'Set up the new mail document
Set MailDoc = MailDB.CREATEDOCUMENT

With MailDoc
.Form = "Memo"
.From = "hcp (AT) medibank (DOT) com.au"
.sendto = email
.CopyTo = copyMail
.blindcopyto = bCopyMail
.Subject = PN & ": HCP SUBMISSION ERROR REPORT - " & Date
.Font = "Courier"


' CODE TO define email body text


.body = mBody

.SAVEMESSAGEONSEND = True
.ReturnReceipt = False
.ConfirmDelivery = True
.replyto = "my email"

End With

MailDoc.PostedDate = Now 'Gets the mail to appear in the sent items
folder
MailDoc.SEND 0, Recipient

'Clean Up
Set MailDB = Nothing
Set MailDoc = Nothing
Set AttachME1 = Nothing
Set AttachME2 = Nothing
Set AttachME3 = Nothing
Set attachErrors = Nothing
Set Session = Nothing
Set EmbedObj = Nothing
End Sub

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.