Notes自动回复邮件

张开发
2026/4/6 3:38:13 15 分钟阅读

分享文章

Notes自动回复邮件
大家好才是真的好。虽然AI但也可以自动回复邮件例如判断一些只需要回复“收到谢谢”的邮件或自动删除一些判断为垃圾的邮件。不过就我觉得现阶段采用Notes自动回复邮件的几种方式还有一些优势的。在Notes客户机中进行自动邮件回复有三个方法第一个是使用“离开办公室”功能不过功能较为简单第二个是创建简单操作代理这个就灵活一点第三个就是使用Lotusscript代码更加强大更能按需定制。我们先说使用简单操作的代理假如你有权限哈鼠标右键在Domino Designer客户机中打开你的邮箱如下图找到代理设计元素点击“新代理”按钮给一个名称例如“自动答复”然后将代理类型更改为“简单操作”如下图确定后点击“添加操作”按钮在操作列表中选择“应答发件人”然后写上消息和内容可以勾选“在消息中包含文档的拷贝”注意这里选择了“只应答每人一次”是为了避免邮件循环邮件循环是指回复发送到错误的电子邮件地址并生成退信给发送方此处指代理。如果退信发送者地址也错误当代理回复退信消息时会生成新的退信消息。退信会被回复再生成新的退信依此类推。只回复每个唯一发件地址一次可以避免这种情况。被回复的地址列表存储在代理本身且列表大小有64kb的限制。一旦列表满了所有新的发件人地址都会被回复就像设置未生效一样。通过禁用并重新启用代理可以清除已回复的地址列表。接着在代理内鼠标右键选择“代理属性”选择触发条件为“新邮件到达前”关闭属性保存关闭即可。该方式参考了https://support.hcl-software.com/csm?idkb_articlesysparm_articleKB0033848很多人觉得该办法不够用需要进行更多内容定制或针对不同的用户例如来自Internet的邮箱进行回复内部的不回复等等别着急我们可以采用Lotusscript来写代码进行自动回复办法还是一样创建代理但这次选择的是Lotusscript代码如下图接着在代理中填入下列代码Dim session As New NotesSession Dim db As NotesDatabase Dim col As NotesDocumentCollection Dim doc As NotesDocument Dim MailDoc As NotesDocument Dim Body As NotesRichTextItem Dim OldBody As NotesRichTextItem Dim OriginalFromAddress As String Dim Subject As String Dim BodyText As String This is the body of the email, Chr(10) indicates a new line you can change the body to whatever you want following this format BodyText Thank you for your inquiry. Chr(10) _ This is an automatically generated response. Please do not reply. Chr(10) _ We will contact you shortly regarding your inquiry. Chr(10) _ Regards, Chr(10)_ John Doe SET THIS TO DESIRED NAME set objects Set db session.CurrentDatabase Set col db.UnprocessedDocuments Set doc col.GetFirstDocument set the subject of the email to go out Subject Re: doc.GetItemValue(Subject)(0) loop through the document collection While Not doc Is Nothing check the address to see if it contains an sign If doc.HasItem(SMTPOriginator) Then OriginalFromAddress doc.GetItemValue(SMTPOriginator)(0) ElseIf doc.HasItem(From) Then OriginalFromAddress doc.GetItemValue(From)(0) Else GoTo nextdoc End If if an sign is found, send a reply If InStr(OriginalFromAddress,) 0 Then create a new mail document Set MailDoc db.CreateDocument set the subject and from fields Call MailDoc.ReplaceItemValue(Subject, Subject) set the body and append the body from the original email Set OldBody doc.GetFirstItem(body) Set body MailDoc.CreateRichTextItem(body) Call body.AppendText(bodyText) Call body.AddNewline(2) Call body.AppendRTItem(oldBody) send the document Call MailDoc.Send(False,OriginalFromAddress) End If Nextdoc: update the processedDoc flag so that this document isnt processed again on a subsequent run Call session.UpdateProcessedDoc(doc) get the next document in the collection Set doc col.GetNextDocument(doc) Wend效果如下图选择触发条件为“新邮件到达后”保存关闭即可。该部分参考了https://support.hcl-software.com/csm?idkb_articlesysparm_articleKB0033178今天内容有点多我们就介绍到这里。最后欢迎搜索公众号“协作者”来关注我。

更多文章