![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |