Lotus Notes out of office 6.5 how to set cc other email?

Hi:

We have gateway cotrol all email all cc dept head otherwise abandon. now lotus domino 6.5 still using but if se outof office agent it reply to the outsider it will prompt and warn u didnt cc to dept head.

Any setting of tuning of lotus can do this ??? confirmed we cannot control the email gateway side. Only think of domino.
LVL 8
barrykflAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cohalexCommented:
You will need to modify the OutOfOffice agent to add a CopyTo field in all reply messages.
You will have to do this change in the mail template, which (by default) is inherited each night into the mail files (this is done by running the design task).

You might have something like this in the OoO agent, Declarations, Class OutOfOfficeAgent, NotifySender method:

add message fields block
change it to:

Call Me.m_noteEmail.ReplaceItemValue ( "Form", "Memo")
		Call Me.m_noteEmail.ReplaceItemValue ( "From", Me.m_NameOwner.canonical )
		Call Me.m_noteEmail.ReplaceItemValue ( "SentBy", Me.m_NameOwner.canonical )
		Call Me.m_noteEmail.ReplaceItemValue ( "Principal", Me.m_NameOwner.canonical )
		Call Me.m_noteEmail.ReplaceItemValue ( "AltFrom", Me.m_NameAltOwner.canonical )
		Call Me.m_noteEmail.ReplaceItemValue ( "SendTo", Me.m_strSendToName )
		Call Me.m_noteEmail.ReplaceItemValue ( "CopyTo", "CCDeptHeadGroup" )
		Call Me.m_noteEmail.ReplaceItemValue ( "AltSendTo", Me.m_strAltFrom  )
		Call Me.m_noteEmail.ReplaceItemValue ( "$LangFrom", Me.m_strLangOwner )
		Call Me.m_noteEmail.ReplaceItemValue ( "$NameLanguageTags", Me.m_strLangFrom)
		Call Me.m_noteEmail.ReplaceItemValue ( "Subject", Me.m_strSubject)
		Call Me.m_noteEmail.ReplaceItemValue ( "$AutoForward", True )
		Call Me.m_noteEmail.ReplaceItemValue ( "GeneratedBy", MSG_AUTOGENERATED  )

Open in new window


Note the new line:
            Call Me.m_noteEmail.ReplaceItemValue ( "CopyTo", "CCDeptHeadGroup" )  

Didn't test it but it should work :)
I have R 8.0.* mail template
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sjef BosmanGroupware ConsultantCommented:
Upgrade to R8.5, it's standard functionality there.
0
barrykflAuthor Commented:
f i must use 6.5 template , is it possible just copy and paste the lines ? i tseem it need new template correspondingly.
0
Introducing the "443 Security Simplified" Podcast

This new podcast puts you inside the minds of leading white-hat hackers and security researchers. Hosts Marc Laliberte and Corey Nachreiner turn complex security concepts into easily understood and actionable insights on the latest cyber security headlines and trends.

cohalexCommented:
Try to find the block, search after "Sub NotifySender" begins.
To create teh new line:
- copy paste the line for "SendTo"
- replace "SendTo" with "CopyTo"
- replace the value (above would the value would be Me.m_strSendToName) with the name of the group in quotes; you could add the Domino mail domain as well, so it would be: "groupname@DomDomain".

If you can't manage it, paste the contents of the Declarations unit here
0
barrykflAuthor Commented:
here is all the code for of office : (where i should replaced) ...need add direct dept head email?

      '//OutOfOffice|OutOfOffice:

Class OutOfOfficeApplication
      Public  m_profileOffice As NotesDocument
      Public  m_calprofile As notesdocument
      Public  m_itemNotified As NotesItem
      Private m_OutOfOfficeLog As noteslog
      Private m_StringTable As MailToolsStringTable
      Private m_collectionUnprocessedNotes As notesdocumentcollection
      Private m_Session As notessession      
      Private m_db As notesdatabase
      Private m_noteDocument As notesdocument
      Private m_noteDisable As notesdocument      
      Private m_noteEmail As NotesDocument
      Private m_rItem As notesrichtextitem
      
      Private m_dtNow As NotesDateTime
      Private m_dtLeave As notesdatetime
      Private m_dtReturn As notesdatetime
      Private m_dtLastRun As notesdatetime
      Private m_dtdelivered As NotesDateTime
      Private m_dtFirstReminderSent As NotesDateTime
      Private m_dtDisableReminderSent As NotesDateTime
      
      Private m_nameOwner As NotesName       
      Private m_nameAltOwner As NotesName
      Private m_nameNotify As NotesName
      Private m_nameFrom As NotesName
      
      Private m_vNamesList As Variant
      Private m_vSendTo As Variant
      Private m_IgnoreSubjectPhrase As Variant
      Private m_vNotified As Variant
      Private m_vFieldData As Variant
      
      Private m_strSubject As String
      Private m_strNameFrom As String
      Private m_strNameAltFrom As String
      Private m_strDomain As String
      Private m_strNotifiedMsg As String
      Private m_strForm As String
      Private m_strAltFrom As String
      Private m_strFrom As String
      Private m_strSendToName As String
      Private m_strMsg As String
      Private m_strLangOwner As String
      Private m_strLangFrom As String
      
      Public  m_nUpdate As Integer
      Private m_nExcludeInternetEmail As Integer
      Private m_nFirstReminder As Integer
      Private m_nSendSpecial As Integer
      
Declare Public Function run() As Integer
      
      Sub New
            Set Me.m_Session = New notessession
            Set Me.m_db = Me.m_Session.currentdatabase
            Set Me.m_OutOfOfficeLog = New NotesLog("Out of Office Log")
            Set Me.m_profileOffice = Me.m_db.GetProfileDocument("OutOfOfficeProfile")
            Call Me.m_OutOfOfficeLog.OpenAgentLog
            Set Me.m_StringTable = New MailToolsStringTable
            Set Me.m_calprofile = Me.m_db.GetProfileDocument("CalendarProfile")
            Set Me.m_nameOwner = New NotesName(Me.m_calprofile.GetItemValue("Owner")(0))
            If Me.m_calprofile.HasItem("AltOwner") Then
                  Set Me.m_nameAltOwner = New NotesName(Me.m_calprofile.GetItemValue("AltOwner")(0))
            Else
                  Set Me.m_nameAltOwner = Me.m_nameOwner
            End If
            If Me.m_calprofile.HasItem("$LangOwner") Then
                  Me.m_strLangOwner = Me.m_calprofile.GetItemValue("$LangOwner")(0)
            Else
                  Me.m_strLangOwner = ""
            End If
            If Me.m_profileOffice.isnewnote Then
                  Print(Me.m_stringtable.GetString(418,Nothing))
                  End
            End If
            If Isnumeric(Me.m_profileOffice.ExcludeInternetEmail(0)) Then
                  Me.m_nExcludeInternetEmail = Cint(Me.m_profileOffice.ExcludeInternetEmail(0))
            Else
                  Me.m_nExcludeInternetEmail = 0
            End If
            Me.m_IgnoreSubjectPhrase = Me.m_profileOffice.IgnoreSubjectPhrase      
            Set Me.m_collectionUnprocessedNotes = Me.m_db.UnprocessedDocuments
            Set Me.m_itemNotified = Me.m_profileOffice.GetFirstItem("Notified")
            Call Me.m_OutOfOfficeLog.LogAction(Cstr(Me.m_collectionUnprocessedNotes.count) & " found for processing.")
      End Sub
      
      Function Run() As Integer
            
            If AgentOKToRun() Then
                  Set Me.m_noteDocument = Me.m_collectionUnprocessedNotes.getfirstdocument
                  While Not Me.m_noteDocument Is Nothing
                        
                        If DocumentOK(Me.m_noteDocument) Then
                              Call NotifySender(Me.m_noteDocument)                              
                        End If
                        
                        Call Me.m_Session.UpdateProcessedDoc(Me.m_noteDocument)
                        Set Me.m_noteDocument = Me.m_collectionUnprocessedNotes.getnextdocument(Me.m_noteDocument)
                  Wend
                  
                  If Me.m_nUpdate Then
                        Call Update
                  End If
            End If
      End Function
      
      Sub Delete
            '// Check for errors were detected
            If (Me.m_OutOfOfficeLog.NumErrors >0) Then
                  Call Me.m_OutOfOfficeLog.LogAction(Cstr(Me.m_OutOfOfficeLog.NumErrors)  & " error detected." )
            Else
                  Call Me.m_OutOfOfficeLog.LogAction("No errors detected.")
            End If
            '// Close log
            Call Me.m_OutOfOfficeLog.Close
            
            If (Me.m_nUpdate) Then
                  Call Update
            End If
            
      End Sub
      
      Sub Update
         '//  track when the agent last ran..
            Set Me.m_dtNow = New NotesDateTime("")
            Me.m_dtNow.SetNow
            Call Me.m_profileOffice.ReplaceItemValue ( "Notified", Me.m_itemNotified)
            Call Me.m_profileOffice.ReplaceItemValue ( "AgentLastRun", Me.m_dtNow)
            Call Me.m_profileOffice.Save(True, False , True)
            Me.m_nUpdate = False            
      End Sub
      
      Sub SendDisableReminder ( FirstReminder As Integer )
            Me.m_vNotified = Me.m_itemNotified.Values
            If FirstReminder Then
                  Me.m_strSubject = Me.m_stringtable.GetString(415,Nothing)                  
                  If Len(Me.m_vNotified(0)) Then
                        Me.m_strNotifiedMsg = Me.m_stringtable.GetString(413,Nothing)
                        Forall a In Me.m_vNotified
                              Set Me.m_nameNotify = New NotesName ( a )
                              If (Strcompare(Me.m_nameNotify.Common, Me.m_nameNotify.Canonical)= 0) Then
                                    Me.m_strNotifiedMsg = Me.m_strNotifiedMsg & Me.m_nameNotify.Common & " (" & Me.m_nameNotify.Canonical & ")" & Chr(10)
                              Else
                                    Me.m_strNotifiedMsg = Me.m_strNotifiedMsg & Me.m_nameNotify.Common & Chr(10)
                              End If
                        End Forall
                  Else
                        Me.m_strNotifiedMsg = Me.m_stringtable.GetString(414,Nothing)
                  End If
            Else
                  Me.m_strSubject = Me.m_stringtable.GetString(443,Nothing)
                  Me.m_strNotifiedMsg = Me.m_stringtable.GetString(416,Nothing)
            End If
            Set Me.m_noteDisable = New NotesDocument(Me.m_db)
            
            Set Me.m_rItem = New NotesRichTextItem(Me.m_noteDisable, "Body")
            
            Call Me.m_noteDisable.ReplaceItemValue ( "Form", "Memo")
            Call Me.m_noteDisable.ReplaceItemValue ( "From", Me.m_NameOwner.canonical )
            Call Me.m_noteDisable.ReplaceItemValue ( "AltFrom", Me.m_NameAltOwner.canonical )
            Call Me.m_noteDisable.ReplaceItemValue ( "SendTo", Me.m_NameOwner.canonical )
            Call Me.m_noteDisable.ReplaceItemValue ( "AltSendTo", Me.m_NameAltOwner.canonical )
            Call Me.m_noteDisable.ReplaceItemValue ( "$LangFrom", Me.m_strLangOwner )
            Call Me.m_noteDisable.ReplaceItemValue ( "$NameLanguageTags", Me.m_strLangOwner )
            Call Me.m_noteDisable.ReplaceItemValue ( "Subject", Me.m_strSubject )
            Call Me.m_noteDisable.ReplaceItemValue ( "$AutoForward", True )
            
            Me.m_rItem.AppendText ( Me.m_strNotifiedMsg )
            
            Me.m_noteDisable.Send (False)
      End Sub
      
      Function AgentOKToRun As Integer
            
            Me.m_nUpdate = True '//  make sure time stamp gets updated on profile note
            
            Set Me.m_dtNow = New NotesDateTime("")
            Me.m_dtNow.SetNow
            Call TIMEGetFromItem("dateFirstDayBack", Me.m_profileOffice, Me.m_dtReturn)
            Call TIMEGetFromItem("dateFirstDayOut", Me.m_profileOffice, Me.m_dtLeave)
            
            '// If this is running after the date return, stop sending Out of Office messages and
            '// start sending reminders to the user to disable it
            If Me.m_dtNow.TimeDifference(Me.m_dtReturn) > 0 Then
                  
            '// Check if the first reminder has been sent
                  If Not Me.m_profileOffice.HasItem("DateFirstReminderSent") Then
                        '// Set Agent running date in Profile
                        Set Me.m_dtFirstReminderSent = New NotesDateTime(Me.m_dtNow.DateOnly)
                        Call Me.m_profileOffice.ReplaceItemValue("DateFirstReminderSent",Me.m_dtFirstReminderSent)
                        Call Me.m_profileOffice.Save(True, False , True)
                        Call Me.m_OutOfOfficeLog.LogAction("First reminder sent.")
                        '// Set flags
                        Me.m_nFirstReminder = True                                                '// Send first reminder flag
                        Call SendDisableReminder(Me.m_nFirstReminder)                  '// Send the reminder
                        Me.m_nUpdate = False                                                      '// We will not update the notified list
                        AgentOKToRun = False                                                      '// Agent should not run. All the work is done!
                        Exit Function
                  '// Check if addional daily reminder is required      
                  Elseif Not Me.m_profileOffice.HasItem("DateDisableReminderSent") Then
                        '// Set Agent running date in Profile
                        Set Me.m_dtDisableReminderSent = New NotesDateTime(Me.m_dtNow.DateOnly)
                        Call Me.m_profileOffice.ReplaceItemValue("DateDisableReminderSent",Me.m_dtDisableReminderSent)
                        Call Me.m_profileOffice.Save(True, False , True)      
                        Call Me.m_OutOfOfficeLog.LogAction("Daily reminder daily sent.")            
                        '// If this is the returning day, we already sent the first additional daily reminder
                        If  Not Cdat(Me.m_dtNow.dateonly) = Cdat(Me.m_dtReturn.dateonly) Then
                              Me.m_nFirstReminder = False                                                 '// Send the first additional daily reminders
                              Call SendDisableReminder(Me.m_nFirstReminder)
                        End If                        
                        Me.m_nUpdate = False
                        AgentOKToRun = False                        
                        Exit Function
                        
                  '// Need to check if we already sent a daily reminder
                  Elseif Me.m_profileOffice.HasItem("DateDisableReminderSent") Then
                        Call TIMEGetFromItem("DateDisableReminderSent", Me.m_profileOffice, Me.m_dtDisableReminderSent)
                        If  Cdat(Me.m_dtNow.dateonly) > Cdat(Me.m_dtDisableReminderSent.dateonly) Then
                              Me.m_nFirstReminder = False                                           '// Send all other additional daily reminders
                              Call SendDisableReminder(Me.m_nFirstReminder)
                              AgentOKToRun = False
                              Me.m_nUpdate = False
                              '// Set Agent running date in Profile
                              Set Me.m_dtDisableReminderSent = New NotesDateTime(Me.m_dtNow.DateOnly)
                              Call Me.m_profileOffice.ReplaceItemValue("DateDisableReminderSent",Me.m_dtDisableReminderSent)
                              Call Me.m_profileOffice.Save(True, False , True)      
                              Call Me.m_OutOfOfficeLog.LogAction("Daily reminder sent.")                                          
                              Exit Function
                        Else '// No reminders needed for today
                              AgentOKToRun = False
                              Me.m_nUpdate = False
                        End If
                  Else '// No reminders needed
                        AgentOKToRun = False
                        Me.m_nUpdate = False
                  End If
            '// If we are running before the user'// s first day out, we remove the Notified list
            Elseif Me.m_dtNow.TimeDifference(Me.m_dtLeave) < 0 Then
                  Call Me.m_profileOffice.ReplaceItemValue ("Notified", "")
                  If Me.m_profileOffice.HasItem("DateFirstReminderSent")Then      '// Clean up for First reminder
                        Call Me.m_profileOffice.RemoveItem ("DateFirstReminderSent")
                  End If            
                  Call Me.m_profileOffice.Save(True, False , True)
                  Call Me.m_OutOfOfficeLog.LogAction("Notified List has been cleared.")
                  AgentOKToRun = False
                  Exit Function
            Else '// We should run Out of Office
                  If Me.m_profileOffice.HasItem("DateFirstReminderSent")Then      '// Clean up for First reminder
                        Call Me.m_profileOffice.RemoveItem ("DateFirstReminderSent")
                  End If            
                  AgentOKToRun = True      
            End If            
      End Function
      
      Function DocumentOK ( doc As NotesDocument )
            
            DocumentOK = False
            '// Note document collection may return a soft deleted note
            If doc.IsDeleted Then
                  Exit Function
            End If                  
            
            '//  if the note has been sent by an agent..
            If doc.HasItem("$AutoForward") Or doc.SentByAgent Then
                  Exit Function
            End If
            
            '// if the user has elected not to respond to mail coming from the internet skip
            If Me.m_nExcludeInternetEmail Then
                  If doc.hasitem("SMTPOriginator") Then
                        Exit Function            
                  End If
            End If
            
          '//   the document must have a delivered date..
            If Not (doc.HasItem("DeliveredDate")) Then
                  Exit Function
            End If
            
            '//  if the documents subject has the phrase in it
            If Not (Me.m_IgnoreSubjectPhrase(0) = "") Then
                  Dim x As Integer                  
                  For x = 0 To Ubound(Me.m_IgnoreSubjectPhrase)
                        If Not Len(Me.m_IgnoreSubjectPhrase(x)) = 0 Then
                              If Instr(doc.Subject(0),Me.m_IgnoreSubjectPhrase(x)) Then
                                    Exit Function                   
                              End If
                        End If
                  Next
            End If
            
            Call TIMEGetFromItem("DeliveredDate", doc, Me.m_dtdelivered)
            If Me.m_dtdelivered Is Nothing Then
                  Exit Function
            End If
            
          '//  the delivered date must be after the first day out...
            If Me.m_dtLeave.TimeDifference(Me.m_dtdelivered) > 0 Then
                  Exit Function
            End If
            
          '//  if doc is a return receipt or a delivery failure report, don't send notice..
            Me.m_strForm = doc.GetItemValue ( "Form")(0)
            If (Strcompare(Me.m_strForm, "Delivery Report") = 0) Then
                  Exit Function
            End If
            
            If (Strcompare(Me.m_strForm, "NonDelivery Report") = 0) Then
                  Exit Function
            End If
            
            If (Strcompare(Me.m_strForm, "Trace Report") = 0 ) Then
                  Exit Function
            End If
            
            If (Strcompare(Me.m_strForm, "Return Receipt")= 0) Then
                  Exit Function
            End If
            
          '//  Check if ReplyTo is checked
            If doc.HasItem("ReplyTo") Then
                  Me.m_strFrom = doc.GetItemValue ( "ReplyTo" )(0)
                  If (Me.m_strFrom = "") Then
                        Goto ContinueFindName      
                  End If
                  If doc.HasItem("$AltReplyTo") Then
                        Me.m_strAltFrom = doc.GetItemValue ( "ReplyTo" )(0)
                        If (Me.m_strFrom = "") Then
                              Goto ContinueFindName      
                        End If
                  Else
                        Me.m_strAltFrom = Me.m_strFrom
                  End If
            Else
ContinueFindName:
                  Me.m_strFrom = doc.GetItemValue ( "From" )(0)
                  If doc.HasItem("AltFrom") Then
                        Me.m_strAltFrom = doc.GetItemValue ( "AltFrom" )(0)
                  Else
                        Me.m_strAltFrom = Me.m_strFrom
                  End If
            End If      
            
            '//  don't send a notice if this is from yourself..
            If CompareNAME(Me.m_strFrom, Me.m_NameOwner.Canonical) Then
                  Exit Function
            End If
            If Not (Me.m_strFrom = Me.m_strAltFrom) Then
                  If Not FindNAMEInList(Me.m_strAltFrom, Me.m_vNamesList) = -1 Then
                        Exit Function
                  End If
            End If
            
          '//  if the sender has already been notified, don't send another notice..
            Me.m_vNamesList = Me.m_itemNotified.Values
            If Not FindNAMEInList(Me.m_strAltFrom, Me.m_vNamesList) = -1 Then
                  Exit Function
            End If
            
          '//  do not send to anyone in the ignore list
            Me.m_vNamesList = Me.m_profileOffice.GetItemValue ("IgnoreFromList")
            If Not FindNAMEInList(Me.m_strAltFrom, Me.m_vNamesList) = -1 Then
                  Exit Function
            End If
            
          '//  do not send if the document was mailed to a group list and you do
          '//  not want the actual sender to be notified or if the document is a
          '//  reminder notice saved by the out of office agent..
            Me.m_vNamesList = Me.m_profileOffice.GetItemValue ("IgnoreSend")
            Me.m_vSendTo = doc.GetItemValue ( "SendTo")
            
            If Len(Me.m_vSendTo(0)) And Len(Me.m_vNamesList(0)) Then
                  Forall a In Me.m_vNamesList
                        Forall b In Me.m_vSendTo
                              If CompareNAME(Cstr(b), Cstr(a)) Then
                                    Exit Function
                              End If
                        End Forall
                  End Forall                  
            End If
            
            DocumentOK = True                        
      End Function      
      
      
      Function CompareNAME (sName1 As String, sName2 As String) As Integer
            '// Function will returns true if two names are equal, False otherwise
            Dim sCanName1 As String
            Dim sDomainName1 As String
            Dim sCanName2 As String
            Dim sDomainName2 As String
            Dim nLenName1 As Integer
            Dim nLenName2 As Integer
            
            Dim name1 As NotesName
            Dim name2 As NotesName
            
            Call GetNAMEComponents(sName1, sCanName1, sDomainName1)
            Call GetNAMEComponents(sName2, sCanName2, sDomainName2)
            
            Set name1 = New NotesName(sCanName1)
            Set name2 = New NotesName(sCanName2)
            
            '// Do a canonical comparison if both names are hierarchical
            If (name1.IsHierarchical) And (name2.IsHierarchical) Then      
                  If (Strcompare(sCanName1, sCanName2, 1) = 0) Then
                        CompareNAME = True
                        Exit Function
                  Else
                        Exit Function            
                  End If
            End If
            
           '// Compare the common names
            If (Strcompare(name1.common, name2.common, 1) = 0) Then
                  CompareNAME = True
                  Exit Function
            End If
            CompareNAME = False
      End Function
      
      Sub GetNAMEComponents(sUserName As String,sRetAbbreviatedName As String,sRetDomain As String)
            '// Given a name, parse and extract proper name and Domain
            Dim nameUser As NotesName
            Set nameUser = New NotesName(sUsername)
            If Not(nameUser.IsHierarchical) Then
                  sRetAbbreviatedName = Strleft(nameUser.addr821,"@")
                  sRetDomain = Strright(nameUser.addr821,"@")
            Else
                  sRetAbbreviatedName = nameUser.abbreviated
                  sRetDomain = ""
            End If
      End Sub
      
      Function FindNAMEInList(sKeyName As String, vListOfNames As Variant) As Integer
            '// Given a name and a list of names return the index position if the user is found, -1 otherwise
            Dim x As Integer
            Dim iNames As Integer
            FindNAMEInList = -1      '//True
            
            If Isempty(vListOfNames) Then
                  Exit Function
            End If
            
            If Isarray(vListOfNames) Then
                  iNames = Ubound(vListOfNames)
                  For x = 0 To iNames
                        If (CompareNAME(sKeyName,Cstr(vListOfNames(x)))) Then
                              FindNAMEInList = x
                              Exit Function
                        End If
                  Next
            Else
                  If (CompareNAME(sKeyName, Cstr(vListOfNames))) Then
                        FindNAMEInList = 0       '// False
                  End If            
            End If
      End Function
      
      Sub AddToNotifiedList ( NameFrom As String )
            '//  add name of sender to the notified list
            
            Set Me.m_nameFrom = New NotesName ( NameFrom )
            Call Me.m_itemNotified.AppendToTextList ( Me.m_nameFrom.Canonical )                  
            Me.m_nUpdate = True
            
      End Sub
      
      Sub NotifySender ( doc As NotesDocument )
            '//  Creates and sends an Out of Office message to the sender
            
            Me.m_vFieldData = Me.m_profileOffice.GetItemValue ( "SpecialPeople")
            
            '//  Check if ReplyTo is checked
            If doc.HasItem("ReplyTo") Then
                  Me.m_strNameFrom = doc.GetItemValue ( "ReplyTo" )(0)
                  If (Me.m_strNameFrom = "") Then
                        Goto ContinueFindNotifier
                  End If                  
                  If doc.Hasitem( "$AltReplyTo" ) Then
                        Me.m_strNameAltFrom = doc.GetItemValue ( "$AltReplyTo" )(0)
                        If (Me.m_strNameAltFrom = "") Then
                              Goto ContinueFindNotifier
                        End If                  
                  Else
                        Me.m_strNameAltFrom = Me.m_strNameFrom
                  End If
            Else
ContinueFindNotifier:
                  Me.m_strNameFrom = doc.GetItemValue ( "From" )(0)
                  If doc.Hasitem( "AltFrom" ) Then
                        Me.m_strNameAltFrom = doc.GetItemValue ( "AltFrom" )(0)
                  Else
                        Me.m_strNameAltFrom = Me.m_strNameFrom
                  End If
            End If
            
            If doc.Hasitem( "$LangFrom" ) Then
                  Me.m_strLangFrom = doc.GetItemValue ( "$LangFrom" )(0)
            Else
                  Me.m_strLangFrom = ""
            End If
            
           '//  Included in special sender list..
            Me.m_nSendSpecial = False
            If Not FindNAMEInList(Me.m_strNameAltFrom, Me.m_vFieldData) = -1 Then
                  Me.m_nSendSpecial = True
            End If
            
            Me.m_strDomain = doc.GetItemValue ("FromDomain")(0)
            If Len(Me.m_strDomain) Then
                  Me.m_strSendToName = Me.m_strNameAltFrom & "@" & Me.m_strDomain'// (0)
            Else
                  Me.m_strSendToName = Me.m_strNameAltFrom
            End If
            
          '//   Build message based on generic message..
            Me.m_vFieldData = Me.m_profileOffice.GetItemValue ( "DaysOut")(0)
            Me.m_strMsg = Me.m_vFieldData & Chr(10) & Chr(10)
            If Me.m_nSendSpecial Then
                  Me.m_vFieldData = Me.m_profileOffice.GetItemValue ( "SpecialMessage")(0)
                  Me.m_strSubject = Me.m_profileOffice.GetItemValue ( "SpecialSubject")(0)
            Else
                  Me.m_vFieldData = Me.m_profileOffice.GetItemValue ( "GeneralMessage")(0)
                  Me.m_strSubject = Me.m_profileOffice.GetItemValue ( "GeneralSubject")(0)
            End If
            
            Me.m_strMsg = Me.m_strMsg & Me.m_vFieldData
            
          '//  send the mail message..
            Set Me.m_noteEmail = New NotesDocument(Me.m_db)
            Set Me.m_rItem = New NotesRichTextItem(Me.m_noteEmail, "Body")
            
            
            'Call Me.m_noteEmail.ReplaceItemValue ( "From", Me.m_NameOwner.canonical )
            'Call Me.m_noteEmail.ReplaceItemValue ( "AltFrom", Me.m_NameAltOwner.canonical '
            'Call Me.m_noteEmail.ReplaceItemValue ( "SendTo", Me.m_strSendToName '
            'Call Me.m_noteEmail.ReplaceItemValue ( "AltSendTo", Me.m_strNameAltFrom  )
            'Call Me.m_noteEmail.ReplaceItemValue ( "$LangFrom", Me.m_strLangOwner )
            'Call Me.m_noteEmail.ReplaceItemValue ( "$NameLanguageTags", Me.m_strLangFrom)
            'Call Me.m_noteEmail.ReplaceItemValue ( "Subject", Me.m_strSubject'
            'Call Me.m_noteEmail.ReplaceItemValue ( "$AutoForward", True )
            Call Me.m_noteEmail.ReplaceItemValue ( "Form", "Memo")
            Call Me.m_noteEmail.ReplaceItemValue ( "From", Me.m_NameOwner.canonical )
            Call Me.m_noteEmail.ReplaceItemValue ( "SentBy", Me.m_NameOwner.canonical )
            Call Me.m_noteEmail.ReplaceItemValue ( "Principal", Me.m_NameOwner.canonical )
            Call Me.m_noteEmail.ReplaceItemValue ( "AltFrom", Me.m_NameAltOwner.canonical )
            Call Me.m_noteEmail.ReplaceItemValue ( "SendTo", Me.m_strSendToName )
            Call Me.m_noteEmail.ReplaceItemValue ( "CopyTo", "CCDeptHeadGroup" )
            Call Me.m_noteEmail.ReplaceItemValue ( "AltSendTo", Me.m_strAltFrom  )
            Call Me.m_noteEmail.ReplaceItemValue ( "$LangFrom", Me.m_strLangOwner )
            Call Me.m_noteEmail.ReplaceItemValue ( "$NameLanguageTags", Me.m_strLangFrom)
            Call Me.m_noteEmail.ReplaceItemValue ( "Subject", Me.m_strSubject)
            Call Me.m_noteEmail.ReplaceItemValue ( "$AutoForward", True )
            'Call Me.m_noteEmail.ReplaceItemValue ( "GeneratedBy", MSG_AUTOGENERATED  )
            
            Me.m_rItem.AppendText ( Me.m_strMsg )
            
            On Error Goto SendError
            Me.m_noteEmail.Send (False)
            
          '//  add the sendto person the list of those notified..
            Call AddToNotifiedList ( Me.m_strNameAltFrom)
            Call Me.m_OutOfOfficeLog.LogAction("Added " & Me.m_strNameAltFrom & " to list" )
            Exit Sub
            
SendError:
          '// Log errors
            Call Me.m_OutOfOfficeLog.LogError( Err, Error$ )
            Exit Sub
      End Sub
      
End Class

0
cohalexCommented:
In your code, the line was already added.
I just added the mail domain (optional):

Call Me.m_noteEmail.ReplaceItemValue ( "CopyTo", "CCDeptHeadGroup@MailDomain" )

Just replace CCDeptHeadGroup with the actual name of your group and MailDomain with your local Domino mail domain (optional)

 
Class OutOfOfficeApplication
	Public  m_profileOffice As NotesDocument
	Public  m_calprofile As notesdocument
	Public  m_itemNotified As NotesItem
	Private m_OutOfOfficeLog As noteslog
	Private m_StringTable As MailToolsStringTable
	Private m_collectionUnprocessedNotes As notesdocumentcollection
	Private m_Session As notessession      
	Private m_db As notesdatabase
	Private m_noteDocument As notesdocument
	Private m_noteDisable As notesdocument      
	Private m_noteEmail As NotesDocument
	Private m_rItem As notesrichtextitem
	
	Private m_dtNow As NotesDateTime
	Private m_dtLeave As notesdatetime
	Private m_dtReturn As notesdatetime
	Private m_dtLastRun As notesdatetime
	Private m_dtdelivered As NotesDateTime
	Private m_dtFirstReminderSent As NotesDateTime
	Private m_dtDisableReminderSent As NotesDateTime
	
	Private m_nameOwner As NotesName       
	Private m_nameAltOwner As NotesName
	Private m_nameNotify As NotesName
	Private m_nameFrom As NotesName
	
	Private m_vNamesList As Variant
	Private m_vSendTo As Variant
	Private m_IgnoreSubjectPhrase As Variant 
	Private m_vNotified As Variant
	Private m_vFieldData As Variant 
	
	Private m_strSubject As String
	Private m_strNameFrom As String
	Private m_strNameAltFrom As String
	Private m_strDomain As String
	Private m_strNotifiedMsg As String
	Private m_strForm As String
	Private m_strAltFrom As String
	Private m_strFrom As String
	Private m_strSendToName As String
	Private m_strMsg As String
	Private m_strLangOwner As String
	Private m_strLangFrom As String
	
	Public  m_nUpdate As Integer
	Private m_nExcludeInternetEmail As Integer
	Private m_nFirstReminder As Integer
	Private m_nSendSpecial As Integer
	
Declare Public Function run() As Integer
	
	Sub New
		Set Me.m_Session = New notessession
		Set Me.m_db = Me.m_Session.currentdatabase
		Set Me.m_OutOfOfficeLog = New NotesLog("Out of Office Log")
		Set Me.m_profileOffice = Me.m_db.GetProfileDocument("OutOfOfficeProfile")
		Call Me.m_OutOfOfficeLog.OpenAgentLog
		Set Me.m_StringTable = New MailToolsStringTable
		Set Me.m_calprofile = Me.m_db.GetProfileDocument("CalendarProfile")
		Set Me.m_nameOwner = New NotesName(Me.m_calprofile.GetItemValue("Owner")(0))
		If Me.m_calprofile.HasItem("AltOwner") Then
			Set Me.m_nameAltOwner = New NotesName(Me.m_calprofile.GetItemValue("AltOwner")(0))
		Else
			Set Me.m_nameAltOwner = Me.m_nameOwner
		End If
		If Me.m_calprofile.HasItem("$LangOwner") Then
			Me.m_strLangOwner = Me.m_calprofile.GetItemValue("$LangOwner")(0)
		Else
			Me.m_strLangOwner = ""
		End If
		If Me.m_profileOffice.isnewnote Then
			Print(Me.m_stringtable.GetString(418,Nothing))
			End
		End If
		If Isnumeric(Me.m_profileOffice.ExcludeInternetEmail(0)) Then
			Me.m_nExcludeInternetEmail = Cint(Me.m_profileOffice.ExcludeInternetEmail(0))
		Else
			Me.m_nExcludeInternetEmail = 0
		End If
		Me.m_IgnoreSubjectPhrase = Me.m_profileOffice.IgnoreSubjectPhrase      
		Set Me.m_collectionUnprocessedNotes = Me.m_db.UnprocessedDocuments
		Set Me.m_itemNotified = Me.m_profileOffice.GetFirstItem("Notified")
		Call Me.m_OutOfOfficeLog.LogAction(Cstr(Me.m_collectionUnprocessedNotes.count) & " found for processing.")
	End Sub
	
	Function Run() As Integer
		
		If AgentOKToRun() Then
			Set Me.m_noteDocument = Me.m_collectionUnprocessedNotes.getfirstdocument
			While Not Me.m_noteDocument Is Nothing
				
				If DocumentOK(Me.m_noteDocument) Then
					Call NotifySender(Me.m_noteDocument)                              
				End If
				
				Call Me.m_Session.UpdateProcessedDoc(Me.m_noteDocument)
				Set Me.m_noteDocument = Me.m_collectionUnprocessedNotes.getnextdocument(Me.m_noteDocument)
			Wend
			
			If Me.m_nUpdate Then
				Call Update
			End If
		End If
	End Function
	
	Sub Delete
            '// Check for errors were detected
		If (Me.m_OutOfOfficeLog.NumErrors >0) Then
			Call Me.m_OutOfOfficeLog.LogAction(Cstr(Me.m_OutOfOfficeLog.NumErrors)  & " error detected." )
		Else
			Call Me.m_OutOfOfficeLog.LogAction("No errors detected.")
		End If
            '// Close log
		Call Me.m_OutOfOfficeLog.Close
		
		If (Me.m_nUpdate) Then
			Call Update
		End If
		
	End Sub
	
	Sub Update
         '//  track when the agent last ran..
		Set Me.m_dtNow = New NotesDateTime("")
		Me.m_dtNow.SetNow
		Call Me.m_profileOffice.ReplaceItemValue ( "Notified", Me.m_itemNotified)
		Call Me.m_profileOffice.ReplaceItemValue ( "AgentLastRun", Me.m_dtNow)
		Call Me.m_profileOffice.Save(True, False , True)
		Me.m_nUpdate = False            
	End Sub
	
	Sub SendDisableReminder ( FirstReminder As Integer )
		Me.m_vNotified = Me.m_itemNotified.Values
		If FirstReminder Then
			Me.m_strSubject = Me.m_stringtable.GetString(415,Nothing)                  
			If Len(Me.m_vNotified(0)) Then
				Me.m_strNotifiedMsg = Me.m_stringtable.GetString(413,Nothing)
				Forall a In Me.m_vNotified
					Set Me.m_nameNotify = New NotesName ( a )
					If (Strcompare(Me.m_nameNotify.Common, Me.m_nameNotify.Canonical)= 0) Then
						Me.m_strNotifiedMsg = Me.m_strNotifiedMsg & Me.m_nameNotify.Common & " (" & Me.m_nameNotify.Canonical & ")" & Chr(10) 
					Else
						Me.m_strNotifiedMsg = Me.m_strNotifiedMsg & Me.m_nameNotify.Common & Chr(10)
					End If
				End Forall 
			Else 
				Me.m_strNotifiedMsg = Me.m_stringtable.GetString(414,Nothing) 
			End If 
		Else
			Me.m_strSubject = Me.m_stringtable.GetString(443,Nothing)
			Me.m_strNotifiedMsg = Me.m_stringtable.GetString(416,Nothing) 
		End If 
		Set Me.m_noteDisable = New NotesDocument(Me.m_db)
		
		Set Me.m_rItem = New NotesRichTextItem(Me.m_noteDisable, "Body")
		
		Call Me.m_noteDisable.ReplaceItemValue ( "Form", "Memo")
		Call Me.m_noteDisable.ReplaceItemValue ( "From", Me.m_NameOwner.canonical )
		Call Me.m_noteDisable.ReplaceItemValue ( "AltFrom", Me.m_NameAltOwner.canonical )
		Call Me.m_noteDisable.ReplaceItemValue ( "SendTo", Me.m_NameOwner.canonical )
		Call Me.m_noteDisable.ReplaceItemValue ( "AltSendTo", Me.m_NameAltOwner.canonical )
		Call Me.m_noteDisable.ReplaceItemValue ( "$LangFrom", Me.m_strLangOwner )
		Call Me.m_noteDisable.ReplaceItemValue ( "$NameLanguageTags", Me.m_strLangOwner )
		Call Me.m_noteDisable.ReplaceItemValue ( "Subject", Me.m_strSubject )
		Call Me.m_noteDisable.ReplaceItemValue ( "$AutoForward", True )
		
		Me.m_rItem.AppendText ( Me.m_strNotifiedMsg )
		
		Me.m_noteDisable.Send (False)
	End Sub
	
	Function AgentOKToRun As Integer
		
		Me.m_nUpdate = True '//  make sure time stamp gets updated on profile note
		
		Set Me.m_dtNow = New NotesDateTime("")
		Me.m_dtNow.SetNow
		Call TIMEGetFromItem("dateFirstDayBack", Me.m_profileOffice, Me.m_dtReturn)
		Call TIMEGetFromItem("dateFirstDayOut", Me.m_profileOffice, Me.m_dtLeave)
		
            '// If this is running after the date return, stop sending Out of Office messages and
            '// start sending reminders to the user to disable it
		If Me.m_dtNow.TimeDifference(Me.m_dtReturn) > 0 Then
			
            '// Check if the first reminder has been sent
			If Not Me.m_profileOffice.HasItem("DateFirstReminderSent") Then
                        '// Set Agent running date in Profile
				Set Me.m_dtFirstReminderSent = New NotesDateTime(Me.m_dtNow.DateOnly)
				Call Me.m_profileOffice.ReplaceItemValue("DateFirstReminderSent",Me.m_dtFirstReminderSent)
				Call Me.m_profileOffice.Save(True, False , True)
				Call Me.m_OutOfOfficeLog.LogAction("First reminder sent.")
                        '// Set flags
				Me.m_nFirstReminder = True                                                '// Send first reminder flag
				Call SendDisableReminder(Me.m_nFirstReminder)                  '// Send the reminder
				Me.m_nUpdate = False                                                      '// We will not update the notified list
				AgentOKToRun = False                                                      '// Agent should not run. All the work is done!
				Exit Function
                  '// Check if addional daily reminder is required      
			Elseif Not Me.m_profileOffice.HasItem("DateDisableReminderSent") Then
                        '// Set Agent running date in Profile
				Set Me.m_dtDisableReminderSent = New NotesDateTime(Me.m_dtNow.DateOnly)
				Call Me.m_profileOffice.ReplaceItemValue("DateDisableReminderSent",Me.m_dtDisableReminderSent)
				Call Me.m_profileOffice.Save(True, False , True)      
				Call Me.m_OutOfOfficeLog.LogAction("Daily reminder daily sent.")            
                        '// If this is the returning day, we already sent the first additional daily reminder
				If  Not Cdat(Me.m_dtNow.dateonly) = Cdat(Me.m_dtReturn.dateonly) Then
					Me.m_nFirstReminder = False                                                 '// Send the first additional daily reminders
					Call SendDisableReminder(Me.m_nFirstReminder)
				End If                        
				Me.m_nUpdate = False
				AgentOKToRun = False                        
				Exit Function
				
                  '// Need to check if we already sent a daily reminder
			Elseif Me.m_profileOffice.HasItem("DateDisableReminderSent") Then
				Call TIMEGetFromItem("DateDisableReminderSent", Me.m_profileOffice, Me.m_dtDisableReminderSent)
				If  Cdat(Me.m_dtNow.dateonly) > Cdat(Me.m_dtDisableReminderSent.dateonly) Then
					Me.m_nFirstReminder = False                                           '// Send all other additional daily reminders
					Call SendDisableReminder(Me.m_nFirstReminder)
					AgentOKToRun = False
					Me.m_nUpdate = False
                              '// Set Agent running date in Profile
					Set Me.m_dtDisableReminderSent = New NotesDateTime(Me.m_dtNow.DateOnly)
					Call Me.m_profileOffice.ReplaceItemValue("DateDisableReminderSent",Me.m_dtDisableReminderSent)
					Call Me.m_profileOffice.Save(True, False , True)      
					Call Me.m_OutOfOfficeLog.LogAction("Daily reminder sent.")                                          
					Exit Function
				Else '// No reminders needed for today
					AgentOKToRun = False
					Me.m_nUpdate = False
				End If
			Else '// No reminders needed 
				AgentOKToRun = False
				Me.m_nUpdate = False
			End If
            '// If we are running before the user'// s first day out, we remove the Notified list
		Elseif Me.m_dtNow.TimeDifference(Me.m_dtLeave) < 0 Then 
			Call Me.m_profileOffice.ReplaceItemValue ("Notified", "")
			If Me.m_profileOffice.HasItem("DateFirstReminderSent")Then      '// Clean up for First reminder
				Call Me.m_profileOffice.RemoveItem ("DateFirstReminderSent")
			End If            
			Call Me.m_profileOffice.Save(True, False , True)
			Call Me.m_OutOfOfficeLog.LogAction("Notified List has been cleared.")
			AgentOKToRun = False
			Exit Function
		Else '// We should run Out of Office
			If Me.m_profileOffice.HasItem("DateFirstReminderSent")Then      '// Clean up for First reminder
				Call Me.m_profileOffice.RemoveItem ("DateFirstReminderSent")
			End If            
			AgentOKToRun = True      
		End If            
	End Function
	
	Function DocumentOK ( doc As NotesDocument )
		
		DocumentOK = False
            '// Note document collection may return a soft deleted note
		If doc.IsDeleted Then 
			Exit Function
		End If                  
		
            '//  if the note has been sent by an agent..
		If doc.HasItem("$AutoForward") Or doc.SentByAgent Then
			Exit Function
		End If
		
            '// if the user has elected not to respond to mail coming from the internet skip
		If Me.m_nExcludeInternetEmail Then
			If doc.hasitem("SMTPOriginator") Then
				Exit Function            
			End If
		End If
		
          '//   the document must have a delivered date..
		If Not (doc.HasItem("DeliveredDate")) Then
			Exit Function 
		End If
		
            '//  if the documents subject has the phrase in it
		If Not (Me.m_IgnoreSubjectPhrase(0) = "") Then
			Dim x As Integer                  
			For x = 0 To Ubound(Me.m_IgnoreSubjectPhrase)
				If Not Len(Me.m_IgnoreSubjectPhrase(x)) = 0 Then
					If Instr(doc.Subject(0),Me.m_IgnoreSubjectPhrase(x)) Then
						Exit Function                   
					End If
				End If
			Next
		End If
		
		Call TIMEGetFromItem("DeliveredDate", doc, Me.m_dtdelivered)
		If Me.m_dtdelivered Is Nothing Then
			Exit Function
		End If
		
          '//  the delivered date must be after the first day out...
		If Me.m_dtLeave.TimeDifference(Me.m_dtdelivered) > 0 Then
			Exit Function
		End If
		
          '//  if doc is a return receipt or a delivery failure report, don't send notice..
		Me.m_strForm = doc.GetItemValue ( "Form")(0)
		If (Strcompare(Me.m_strForm, "Delivery Report") = 0) Then
			Exit Function
		End If
		
		If (Strcompare(Me.m_strForm, "NonDelivery Report") = 0) Then
			Exit Function
		End If
		
		If (Strcompare(Me.m_strForm, "Trace Report") = 0 ) Then
			Exit Function
		End If
		
		If (Strcompare(Me.m_strForm, "Return Receipt")= 0) Then
			Exit Function
		End If
		
          '//  Check if ReplyTo is checked
		If doc.HasItem("ReplyTo") Then
			Me.m_strFrom = doc.GetItemValue ( "ReplyTo" )(0)
			If (Me.m_strFrom = "") Then
				Goto ContinueFindName      
			End If
			If doc.HasItem("$AltReplyTo") Then
				Me.m_strAltFrom = doc.GetItemValue ( "ReplyTo" )(0)
				If (Me.m_strFrom = "") Then
					Goto ContinueFindName      
				End If
			Else
				Me.m_strAltFrom = Me.m_strFrom
			End If
		Else
ContinueFindName:
			Me.m_strFrom = doc.GetItemValue ( "From" )(0)
			If doc.HasItem("AltFrom") Then
				Me.m_strAltFrom = doc.GetItemValue ( "AltFrom" )(0)
			Else
				Me.m_strAltFrom = Me.m_strFrom
			End If
		End If      
		
            '//  don't send a notice if this is from yourself..
		If CompareNAME(Me.m_strFrom, Me.m_NameOwner.Canonical) Then
			Exit Function
		End If
		If Not (Me.m_strFrom = Me.m_strAltFrom) Then
			If Not FindNAMEInList(Me.m_strAltFrom, Me.m_vNamesList) = -1 Then
				Exit Function
			End If
		End If
		
          '//  if the sender has already been notified, don't send another notice..
		Me.m_vNamesList = Me.m_itemNotified.Values
		If Not FindNAMEInList(Me.m_strAltFrom, Me.m_vNamesList) = -1 Then
			Exit Function
		End If
		
          '//  do not send to anyone in the ignore list
		Me.m_vNamesList = Me.m_profileOffice.GetItemValue ("IgnoreFromList")
		If Not FindNAMEInList(Me.m_strAltFrom, Me.m_vNamesList) = -1 Then
			Exit Function
		End If
		
          '//  do not send if the document was mailed to a group list and you do
          '//  not want the actual sender to be notified or if the document is a 
          '//  reminder notice saved by the out of office agent..
		Me.m_vNamesList = Me.m_profileOffice.GetItemValue ("IgnoreSend")
		Me.m_vSendTo = doc.GetItemValue ( "SendTo")
		
		If Len(Me.m_vSendTo(0)) And Len(Me.m_vNamesList(0)) Then
			Forall a In Me.m_vNamesList
				Forall b In Me.m_vSendTo
					If CompareNAME(Cstr(b), Cstr(a)) Then
						Exit Function
					End If
				End Forall
			End Forall                  
		End If
		
		DocumentOK = True                        
	End Function      
	
	
	Function CompareNAME (sName1 As String, sName2 As String) As Integer
            '// Function will returns true if two names are equal, False otherwise
		Dim sCanName1 As String
		Dim sDomainName1 As String
		Dim sCanName2 As String
		Dim sDomainName2 As String
		Dim nLenName1 As Integer
		Dim nLenName2 As Integer
		
		Dim name1 As NotesName
		Dim name2 As NotesName
		
		Call GetNAMEComponents(sName1, sCanName1, sDomainName1)
		Call GetNAMEComponents(sName2, sCanName2, sDomainName2)
		
		Set name1 = New NotesName(sCanName1)
		Set name2 = New NotesName(sCanName2)
		
            '// Do a canonical comparison if both names are hierarchical
		If (name1.IsHierarchical) And (name2.IsHierarchical) Then      
			If (Strcompare(sCanName1, sCanName2, 1) = 0) Then
				CompareNAME = True
				Exit Function
			Else
				Exit Function            
			End If
		End If
		
           '// Compare the common names
		If (Strcompare(name1.common, name2.common, 1) = 0) Then
			CompareNAME = True
			Exit Function
		End If
		CompareNAME = False
	End Function
	
	Sub GetNAMEComponents(sUserName As String,sRetAbbreviatedName As String,sRetDomain As String)
            '// Given a name, parse and extract proper name and Domain 
		Dim nameUser As NotesName
		Set nameUser = New NotesName(sUsername) 
		If Not(nameUser.IsHierarchical) Then
			sRetAbbreviatedName = Strleft(nameUser.addr821,"@")
			sRetDomain = Strright(nameUser.addr821,"@")
		Else
			sRetAbbreviatedName = nameUser.abbreviated
			sRetDomain = ""
		End If
	End Sub
	
	Function FindNAMEInList(sKeyName As String, vListOfNames As Variant) As Integer
            '// Given a name and a list of names return the index position if the user is found, -1 otherwise
		Dim x As Integer
		Dim iNames As Integer
		FindNAMEInList = -1      '//True
		
		If Isempty(vListOfNames) Then
			Exit Function
		End If
		
		If Isarray(vListOfNames) Then
			iNames = Ubound(vListOfNames)
			For x = 0 To iNames
				If (CompareNAME(sKeyName,Cstr(vListOfNames(x)))) Then
					FindNAMEInList = x
					Exit Function
				End If
			Next
		Else
			If (CompareNAME(sKeyName, Cstr(vListOfNames))) Then
				FindNAMEInList = 0       '// False
			End If            
		End If
	End Function
	
	Sub AddToNotifiedList ( NameFrom As String )
            '//  add name of sender to the notified list
		
		Set Me.m_nameFrom = New NotesName ( NameFrom )
		Call Me.m_itemNotified.AppendToTextList ( Me.m_nameFrom.Canonical )                  
		Me.m_nUpdate = True
		
	End Sub
	
	Sub NotifySender ( doc As NotesDocument ) 
            '//  Creates and sends an Out of Office message to the sender
		
		Me.m_vFieldData = Me.m_profileOffice.GetItemValue ( "SpecialPeople")
		
            '//  Check if ReplyTo is checked
		If doc.HasItem("ReplyTo") Then
			Me.m_strNameFrom = doc.GetItemValue ( "ReplyTo" )(0)
			If (Me.m_strNameFrom = "") Then
				Goto ContinueFindNotifier
			End If                  
			If doc.Hasitem( "$AltReplyTo" ) Then
				Me.m_strNameAltFrom = doc.GetItemValue ( "$AltReplyTo" )(0)
				If (Me.m_strNameAltFrom = "") Then
					Goto ContinueFindNotifier
				End If                  
			Else
				Me.m_strNameAltFrom = Me.m_strNameFrom
			End If
		Else
ContinueFindNotifier:
			Me.m_strNameFrom = doc.GetItemValue ( "From" )(0)
			If doc.Hasitem( "AltFrom" ) Then
				Me.m_strNameAltFrom = doc.GetItemValue ( "AltFrom" )(0)
			Else
				Me.m_strNameAltFrom = Me.m_strNameFrom
			End If
		End If
		
		If doc.Hasitem( "$LangFrom" ) Then
			Me.m_strLangFrom = doc.GetItemValue ( "$LangFrom" )(0)
		Else
			Me.m_strLangFrom = ""
		End If
		
           '//  Included in special sender list..
		Me.m_nSendSpecial = False
		If Not FindNAMEInList(Me.m_strNameAltFrom, Me.m_vFieldData) = -1 Then
			Me.m_nSendSpecial = True
		End If
		
		Me.m_strDomain = doc.GetItemValue ("FromDomain")(0)
		If Len(Me.m_strDomain) Then
			Me.m_strSendToName = Me.m_strNameAltFrom & "@" & Me.m_strDomain'// (0)
		Else
			Me.m_strSendToName = Me.m_strNameAltFrom
		End If
		
          '//   Build message based on generic message..
		Me.m_vFieldData = Me.m_profileOffice.GetItemValue ( "DaysOut")(0)
		Me.m_strMsg = Me.m_vFieldData & Chr(10) & Chr(10)
		If Me.m_nSendSpecial Then
			Me.m_vFieldData = Me.m_profileOffice.GetItemValue ( "SpecialMessage")(0)
			Me.m_strSubject = Me.m_profileOffice.GetItemValue ( "SpecialSubject")(0)
		Else
			Me.m_vFieldData = Me.m_profileOffice.GetItemValue ( "GeneralMessage")(0)
			Me.m_strSubject = Me.m_profileOffice.GetItemValue ( "GeneralSubject")(0)
		End If
		
		Me.m_strMsg = Me.m_strMsg & Me.m_vFieldData
		
          '//  send the mail message..
		Set Me.m_noteEmail = New NotesDocument(Me.m_db)
		Set Me.m_rItem = New NotesRichTextItem(Me.m_noteEmail, "Body")
		
		
            'Call Me.m_noteEmail.ReplaceItemValue ( "From", Me.m_NameOwner.canonical )
            'Call Me.m_noteEmail.ReplaceItemValue ( "AltFrom", Me.m_NameAltOwner.canonical '
            'Call Me.m_noteEmail.ReplaceItemValue ( "SendTo", Me.m_strSendToName '
            'Call Me.m_noteEmail.ReplaceItemValue ( "AltSendTo", Me.m_strNameAltFrom  )
            'Call Me.m_noteEmail.ReplaceItemValue ( "$LangFrom", Me.m_strLangOwner )
            'Call Me.m_noteEmail.ReplaceItemValue ( "$NameLanguageTags", Me.m_strLangFrom)
            'Call Me.m_noteEmail.ReplaceItemValue ( "Subject", Me.m_strSubject'
            'Call Me.m_noteEmail.ReplaceItemValue ( "$AutoForward", True )
		Call Me.m_noteEmail.ReplaceItemValue ( "Form", "Memo")
		Call Me.m_noteEmail.ReplaceItemValue ( "From", Me.m_NameOwner.canonical )
		Call Me.m_noteEmail.ReplaceItemValue ( "SentBy", Me.m_NameOwner.canonical )
		Call Me.m_noteEmail.ReplaceItemValue ( "Principal", Me.m_NameOwner.canonical )
		Call Me.m_noteEmail.ReplaceItemValue ( "AltFrom", Me.m_NameAltOwner.canonical )
		Call Me.m_noteEmail.ReplaceItemValue ( "SendTo", Me.m_strSendToName )
		Call Me.m_noteEmail.ReplaceItemValue ( "CopyTo", "CCDeptHeadGroup@MailDomain" )
		Call Me.m_noteEmail.ReplaceItemValue ( "AltSendTo", Me.m_strAltFrom  )
		Call Me.m_noteEmail.ReplaceItemValue ( "$LangFrom", Me.m_strLangOwner )
		Call Me.m_noteEmail.ReplaceItemValue ( "$NameLanguageTags", Me.m_strLangFrom)
		Call Me.m_noteEmail.ReplaceItemValue ( "Subject", Me.m_strSubject)
		Call Me.m_noteEmail.ReplaceItemValue ( "$AutoForward", True )
            'Call Me.m_noteEmail.ReplaceItemValue ( "GeneratedBy", MSG_AUTOGENERATED  )
		
		Me.m_rItem.AppendText ( Me.m_strMsg )
		
		On Error Goto SendError
		Me.m_noteEmail.Send (False)
		
          '//  add the sendto person the list of those notified..
		Call AddToNotifiedList ( Me.m_strNameAltFrom)
		Call Me.m_OutOfOfficeLog.LogAction("Added " & Me.m_strNameAltFrom & " to list" )
		Exit Sub
		
SendError:
          '// Log errors 
		Call Me.m_OutOfOfficeLog.LogError( Err, Error$ )
		Exit Sub
	End Sub
	
End Class

Open in new window

0
barrykflAuthor Commented:
nil
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.