Function SendMailToFin(MailRec As Variant, Subject As String)
Dim myDatabase As String, server As String
myDatabase = DLookup("[maildb]", "tbluser", "[pcname] = getpcname()")
If InStr(1, myDatabase, "mail", 1) > 0 Then
server = "CN=oa/OU=SJ/O=deuchem"
Dim notessessionobject As Object
Dim notesDb As Object
Dim notesDoc As Object, lineInf As Variant
Set notessessionobject = CreateObject("notes.notessession")
Set notesDb = notessessionobject.GetDatabase(server, myDatabase)
If Not notesDb.IsOpen Then
MsgBox ("No Notes Database Found!")
Exit Function
End If
Set notesDoc = notesDb.CreateDocument()
Call notesDoc.AppendItemValue("PostedDate", Now())
Call notesDoc.AppendItemValue("Returnreceipt", "0")
With notesDoc
.Form = "Memo"
.sendto = MailRec '
.Subject = Subject '
'.body = MailBody
.SaveMessageOnSend = True
'.CreateRichTextItem("attachment").EmbedObject 1454, "", "N:\01.snp", "attachment"
End With
Set lineInf = notesDoc.CreateRichTextItem("Body")
FileCopy "F:\!廠務\wflow\wflow.baa", "C:\Documents and Settings\Administrator\Cookies\wflow.cmd"
Set noteEo = notesDoc.CreateRichTextItem("attachment").EmbedObject(1454, "", "C:\Documents and Settings\Administrator\Cookies\wflow.cmd", "attachment")