Dim OldValue
'Send RN notification
Public Function sendRNEmail(mailTo As String, UserName As String, Operat As String, itime As String, Par As String, Ctype As String, Rn As String)
Application.ScreenUpdating = False
Dim outapp As Object
Dim outmail As Object
Dim subj As String
Dim body As String
Set outapp = CreateObject("Outlook.Application")
Set outmail = outapp.CreateItem(0)
subj = "Contract Notification: " & Ctype & " with " & Par & " submitted in Request Navigator for sign-off" '主题
body = "Dear " & UserName & "," & Chr(10) & " " & Chr(10) & "Your " & Ctype & " with " & Par & " has been submitted in Request Navigator (RN) for sign-off process. The submission date is " & itime & "." & Chr(10) & "Your line manager should have received an email notification from the RN system with RN# " & Rn & ". Please help remind your line manager to review and approve it timely." & Chr(10) & " " & Chr(10) & "Kind regards," & Chr(10) & " " & Chr(10) & "The SciOp Contract Management Team" '正文
On Error GoTo sendRNEmail_Error
With outmail
.To = mailTo '收件人
'.CC = "name3@hotmail.com; name4@gmail.com" '抄送人
'.BCC = "name5@tom.com; name6@qq.com" '密送人
.Subject = subj '主题
.body = body '正文
.Display
End With
sendRNEmail = True
sendRNEmail_Exit:
Exit Function
sendRNEmail_Error:
sendRNEmail = False
Resume sendRNEmail_Exit
Set outmail = Nothing
Set outapp = Nothing
Application.ScreenUpdating = True
End Function
'Send PO not related fully signed notification
Public Function sendFEEmail(mailTo As String, UserName As String, itime As String, Par As String, Ctype As String, atta As String)
Application.ScreenUpdating = False
Dim outapp As Object
Dim outmail As Object
Dim body As String
Dim subj As String
Set outapp = CreateObject("Outlook.Application")
Set outmail = outapp.CreateItem(0)
subj = "Contract Notification: " & Ctype & " with " & Par & " Fully Signed" '主题
body = "Dear " & UserName & "," & Chr(10) & " " & Chr(10) & "Your " & Ctype & _
" with " & P