Creating an email and sending it with an attachment via VB is pretty simple. You can just adjust the following and use however you wish.
set objEmail = CreateObject("CDO.Message")
objEmail.From = "someone@somewhere.com"
objEmail.To = "someone@somewhere.com"
objEmail.Subject = "Subject Here"
objEmail.TextBody = "Message Here"
objEmail.AddAttachment "C:\someFile.zip"
objEmail.Configuration.Fields("http://schemas.microsoft.com/cdo/ configuration/sendusing") = 2
objEmail.Configuration.Fields("http://schemas.microsoft.com/cdo/ configuration/smtpserver") = "server" objEmail.Configuration.Fields.Update objEmail.Send
No comments:
Post a Comment