VBA 关于编辑不同的单元格触发不同邮件的功能

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值