sub includeFile (fSpec)
dim fileSys, file, fileData
set fileSys = createObject ("Scripting.FileSystemObject")
set file = fileSys.openTextFile (fSpec)
fileData = file.readAll ()
file.close
executeGlobal fileData
set file = nothing
set fileSys = nothing
end sub
includeFile "body.vbi"
' sdt 为今日日期的字符串,比如 '2010-12-9',可用于附件名字里
sdt = FormatDateTime(Date)
' 注意:以单引号'开头的行为注释
' receiptions 为收件人列表,多个收件人之间用分号隔开
' Subject 为邮件标题
' Body 为邮件正文
' Attachments 为附件列表,每个附件都需附带路径。
receiptions = "xxx@xxx.com.cn"
Subject = "报告 " & sdt
Body = exBody
Attachments = Array("E:\q.gif","E:\code\python\bug.gif")
' 以下代码无需修改
Dim xOutLook
Dim xMail
On Error Resume Next
Set xOutLook = GetObject(, "Outlook.Application")
If xOutLook Is Nothing Then
Set x
使用vbs发送email的模板
最新推荐文章于 2022-06-05 10:10:04 发布