Hi All, We have an agent which popups a dialogbox ,in which the “To”,“Cc” and “Subject” fields are populated and a mail is sent to the users listed in “To” and “Cc” fields.
As of now we don't have any issues with "To" field.In "Cc" field we are getting the Admin Name and the Author of the document.At the time of debugging we are able to see the Admin Name and Author Name .Even at the time of populating also..its populating correctly.But after sending mail..If i check my mail box..I see only Admin in the cc field.Author is missing in the "Cc".I have tested many times.Once i am getting both the users in "Cc" and some times only Admin.Can any one suggest whats the problem?
Below is my code.
Sub Sendmail(fru As Variant,div As Variant,auth As NotesName)
Dim session As New NotesSession
Dim wrk As New NotesUIWorkspace
Dim doc As NotesDocument, dialogdoc As NotesDocument
Dim flag As Integer
Dim maildoc As NotesDocument
Dim body1 As NotesRichTextItem
Dim rti As NotesRichTextItem
Dim nam As NotesName
Dim nam1 As NotesName
Dim achanta As String
Set db = session.currentdatabase
Set nam= New NotesName(session.Username)
Set nam1= New NotesName(auth.Abbreviated)
achanta=auth.abbreviated
Set dialogdoc = New NotesDocument(cur_db)
dialogdoc.Form = "dlgSendForm"
dialogdoc.fldSubject=div + " " +fru
dialogdoc.fldCC= achanta + " , "+ nam.Abbreviated
flag = wrk.DialogBox("dlgSendForm" , True , False , False , False , False , False , "Update Field Value" , dialogdoc, True)
Dim temp As Variant
Dim i As Integer
Dim j As Integer
Dim success As Boolean
If flag Then
Set maildoc = db.Createdocument()
Set rti = New NotesRichTextItem(maildoc, "Body")
maildoc.form = "Memo"
maildoc.subject = dialogdoc.fldSubject(0)
'assigning the send to
For i=0 To UBound(dialogdoc.fldTO)
ReDim Preserve mth1(i) As String
'ReDim Preserve mth2(i) As String
mth1(i)=dialogdoc.fldTO(i)
Next
For j=0 To UBound(dialogdoc.fldCC)
ReDim Preserve mth2(j) As String
mth2(j)=dialogdoc.fldCC(j)
Next
maildoc.Sendto=mth1
maildoc.CopyTo=mth2
MsgBox maildoc.CopyTo(0)
Dim test As String
test=dialogdoc.fldBody(0)
Call rti.Appendtext(test)
Call maildoc.Send(False)
End If
End Sub