Jump to content

Recommended Posts

Posted

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

 

 

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...