andydis Posted November 12, 2010 Posted November 12, 2010 hello Edugeekers, Some users find it too much of a task to send an email to report problems, I would like to put a vbs script on staff laptops that does the following:- 1) sends an email to only 1 email address via an smtp server 2) the "body" of the email should include what a usertypes in a input box. I have seen examples on the web to send emails how i want ( script below) but do not know how to get the "userinput" to include in the bosy of the email .... help? Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.From = "[email protected]" objMessage.To = "[email protected]" objMessage.TextBody = "This is some sample message text." '==This section provides the configuration information for the remote SMTP server. '==Normally you will only change the server name or IP. objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Name or IP of Remote SMTP Server objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.myserver.com" 'Server port (typically 25) objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objMessage.Configuration.Fields.Update '==End remote SMTP server configuration section== objMessage.Send
localzuk Posted November 12, 2010 Posted November 12, 2010 I'd replace objMessage.TextBody = "This is some sample message text." with objMessage.TextBody = InputBox("Enter your problem") This will then display an input box, and the output of that box will be set as the body.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now