0

我需要发送一个附加到电子邮件的文件,该文件必须通过具有身份验证的 smtp 服务器设置给特定用户。我怎么能在 vbscript 中做到这一点?谢谢。

4

2 回答 2

2

你可以看看这里:

如何在 vb.net 中发送带附件的电子邮件?

尝试以下操作:

Dim oMsg As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage() 

oMsg.From = "noone@nobody.com" 
oMsg.To = "someone@somewhere.com" 
oMsg.Subject = "Email with Attachment Demo" 
oMsg.Body = "This is the main body of the email" 
Dim oAttch As MailAttachment = New MailAttachment("C:\myattachment.zip") 
oMsg.Attachments.Add(oAttch) 
SmtpMail.Send(oMsg)
于 2013-05-08T11:43:44.820 回答
1

在这方面我没有使用 VB 的 vbscript 的经验......但是一个快速的谷歌给了我这个结果- 它看起来很简单。

我希望这有帮助 :)

于 2013-05-08T11:47:14.260 回答