我需要发送附加到电子邮件的文件,该文件必须通过带有auth的smtp服务器发送给特定用户。我怎么能在vbscript中做到这一点? 感谢。
答案 0 :(得分:2)
你可以看看这里:
how to send an email with attachment in 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)
答案 1 :(得分:1)
我对VB的vbscript有没有经验......但是Google快速给了我this result - 它看起来很简单。
我希望这会有所帮助:)