Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending E-mail from a vbs file

Status
Not open for further replies.

mluken

Programmer
Dec 31, 2003
54
US
I want to create a vbs file that sends an E-mail message when certain system events happen. So my vbscript looks as follows:

Set Mail = Server.CreateObject("Persists.MailSender")
Mail.Host = smtpServer

Mail.From = addy_from
Mail.FromName = addy_from
Mail.AddAddress addy

Mail.AddAttachment logFile

Mail.Subject = "Logs"
Mail.Body = "Log"

On Error Resume Next
Mail.Send
On Error GoTo 0


However, I am getting an error that says "Object required: 'Server'".... That is referring to the Server.CreateObject portion of my code. Now I do have aspemail installed on my machine. Isnt that all that I need? What am I missing?
 
If you are just running this on your local box, try using CreateObject instead of Server.CreateObject.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top