1.

Solve : Send email VIA a Vb Script?

Answer»

Does anyone know of a WAY to send a email with an Attachment to a Email account using VBScript and or batch file??

Code: [Select]
Dim objMail: Set objEmail = CreateObject("CDO.Message")
objEmail.From = "FromEmailAddr"
objEmail.To = "ToEmailAddr.com"
objEmail.Subject = "subject"
objEmail.Textbody = "Body"
objEmail.AddAttachment "FileToAttach"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "YourSMTPServerName"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send

set objEmail = Nothing
WScript.Quit


You fill in the from and to email addresses. Fill in the file name to attach and your SMTP server name (get from your ISP). Do not change sendusing or smtpserverport settings.

Hope this helps.

PS. There is a special place in *censored* for spammers. Quote

PS. There is a special place in *censored* for spammers.


lmao...I sure hope there is...

What USE would sending a batch file be for ANYTHING other than spamming?I use a script to backup a number of machines. I have each script send an email to my address with the job log attached. That way I can check all the machines without actually having to VISIT them.

tricky tricky tricky....

I am amazed...lolThanks sidewinder.

I am not using it to spam people what I want to is AUTOMATE a backup of my pc to my gmail account.


Discussion

No Comment Found