繁体   English   中英

使用VBscript发送附件时为其命名

[英]Giving an attachment a name when sending it with VBscript

set cdoConfig = CreateObject("CDO.Configuration")
with cdoConfig.Fields
  .Item(cdoSendUsingMethod) = cdoSendUsingPort
  .Item(cdoSMTPServer) = "localhost"
  .Item(cdoSMTPAuthenticate) = 1
  .Item(cdoSendUsername) = "contact@example.com"
  .Item(cdoSendPassword) = "password"
  .Update
end with
set cdoMessage = CreateObject("CDO.Message")
with cdomessage
set .Configuration = cdoConfig
  .From = "contact@example.com"
  .To = email
  .Subject = subject
  .HTMLBody = message
  .AddAttachment "c:/i/report.pdf"
  .Send
end with
set cdomessage = nothing
set cdoconfig = nothing

一切都会发送发现,但是接收者会收到消息“ Untitled Attachment 000X.pdf”

如何给附件起个名字?

我有这样的东西。 但从未尝试过。

'With cdomessage

.AddAttachment "c:/i/report.pdf"
.Attachments(1).Fields.Item("urn:schemas:mailheader:content-disposition") ="attachment;filename=" & NEWNAME
.Attachments(1).Fields.Update

'End With

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM