【发布时间】:2022-01-17 08:50:19
【问题描述】:
我需要 LotusScript 代理操作按钮来向多个收件人发送电子邮件,这些收件人的邮件地址将从 csv 或 excel 文件中读取。我必须向几百个收件人发送相同的邮件,从 excel 文件发送邮件比单独键入或复制每个邮件要容易得多。我在 HCL 站点上找到了“Send”方法并使用静态数组示例实现:
Sub Click(Source As Button)
Dim s As NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim rtitem as NotesRichTextItem
Set s = New NotesSession
Set db = s.CurrentDatabase
Set doc = New NotesDocument(db)
'----------------------------------------------------------------------
' Build static list of email addresses
'----------------------------------------------------------------------
Dim addresses (1 to 3) as String
addresses(1) = "EMAIL"
addresses(2) = "EMAIL"
addresses(3) = "EMAIL"
'----------------------------------------------------------------------
' Create and send email message
'----------------------------------------------------------------------
doc.Form = "Memo"
doc.SendTo = addresses
doc.Subject = "This is the message subject"
Set rtitem = New NotesRichTextItem(doc, "Body")
Call rtitem.AddNewLine(1)
Call rtitem.AppendText("The body of the email message.")
doc.Send (True)
Msgbox "Sample email sent"
End Sub
此操作按钮应向 3 个收件人或我手动输入代码的多个收件人发送电子邮件,但有没有办法从 csv 或 excel 文件向收件人发送电子邮件?
【问题讨论】:
标签: excel email lotus-notes lotus-domino lotusscript