Solved

How do I copyTo multiple recipients

Posted on 2004-04-30
3
550 Views
Last Modified: 2013-12-18
How do I modify the following code, so that the message is copied to both john.doe@myCompany.com AND jane.doe@myCompany.com. Although I've tried doing an array, like so:

recip(0)="john.doe@myCompany.com"
recip(2)="jane.doe@myCompany.com"

I'm doing some wrong because I keep getting scripting errors.

Here's the code I need to modify:


Sub Initialize
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim doc As NotesDocument
      Dim memo As NotesDocument
      Dim rtitem As NotesRichTextItem
      Set db = session.CurrentDatabase
      Dim sendto As Variant
      Set doc=session.documentcontext
      sendto="Information Center@ExchangeNA"
      If doc.IsNewNote Then  
            Set memo = New NotesDocument( db )
            Set rtitem = New NotesRichTextItem( memo, "Body" )
            msg="A new report request has been submitted. You can view the request on the web at: " & Chr(10) & Chr(10)
            msg2= "Please open the Information Center Reports database in Lotus Notes and mark the status of the request."            
            url="http://nycnotes11.myCompany.com/" & StringReplaceSubstring(db.FilePath, "\", "/") & "/ChangeNum/" & doc.UniversalID & "?OpenDocument"
            Call rtitem.AppendText(msg & url & Chr(10) & Chr(10) & msg2)
            memo.Subject = "New Report Request"
            memo.CopyTo="john.doe@myCompany.com"            
            memo.BlindCopyTo="the.man@myCompany.com"
            Call memo.Send( False, sendto)
            Call doc.save(True,False)
      End If      
End Sub
0
Comment
Question by:GessWurker
  • 2
3 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10961003
Replace this line

memo.CopyTo="john.doe@myCompany.com"  

to

memo.CopyTo= recip

~Hemanth
0
 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 500 total points
ID: 10961035
The complete code will be

Sub Initialize
     Dim session As New NotesSession
     Dim db As NotesDatabase
     Dim doc As NotesDocument
     Dim memo As NotesDocument
     Dim rtitem As NotesRichTextItem
Dim recip(1) as string
recip(0)="john.doe@myCompany.com"
recip(1)="jane.doe@myCompany.com"
     Set db = session.CurrentDatabase
     Dim sendto As Variant
     Set doc=session.documentcontext
     sendto="Information Center@ExchangeNA"
     If doc.IsNewNote Then  
          Set memo = New NotesDocument( db )
          Set rtitem = New NotesRichTextItem( memo, "Body" )
          msg="A new report request has been submitted. You can view the request on the web at: " & Chr(10) & Chr(10)
          msg2= "Please open the Information Center Reports database in Lotus Notes and mark the status of the request."          
          url="http://nycnotes11.myCompany.com/" & StringReplaceSubstring(db.FilePath, "\", "/") & "/ChangeNum/" & doc.UniversalID & "?OpenDocument"
          Call rtitem.AppendText(msg & url & Chr(10) & Chr(10) & msg2)
          memo.Subject = "New Report Request"
memo.CopyTo= recip    
          memo.BlindCopyTo="the.man@myCompany.com"
          Call memo.Send( False, sendto)
          Call doc.save(True,False)
     End If    
End Sub
0
 

Author Comment

by:GessWurker
ID: 10961113
Thanks!
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now