Reputation: 31
i need to send a file attached to an email that must be setn to specific user through smtp server with auth. How can i do that in vbscript? Thanks.
Upvotes: 0
Views: 11467
Reputation: 686
You can just take a look here:
how to send an email with attachment in vb.net?
Try the following:
Dim oMsg As System.Web.Mail.MailMessage = New System.Web.Mail.MailMessage()
oMsg.From = "[email protected]"
oMsg.To = "[email protected]"
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)
Upvotes: 2
Reputation: 272
I have no experience with vbscript of VB for that matter... But a quick Google gave me this result - it looks simple enough.
I hope this helps :)
Upvotes: 1