+ Post New Thread
Results 1 to 2 of 2
Coding Thread, vbs send mail with body input in Coding and Web Development; hello Edugeekers, Some users find it too much of a task to send an email to report problems, I would ...
  1. #1

    Join Date
    Jul 2009
    Posts
    272
    Thank Post
    6
    Thanked 43 Times in 37 Posts
    Rep Power
    16

    vbs send mail with body input

    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 = "me@my.com"
    objMessage.To = "test@paulsadowski.com"
    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


  2. #2

    localzuk's Avatar
    Join Date
    Dec 2006
    Location
    Minehead
    Posts
    17,697
    Thank Post
    516
    Thanked 2,455 Times in 1,899 Posts
    Blog Entries
    24
    Rep Power
    833
    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.

SHARE:
+ Post New Thread

Similar Threads

  1. Unable to send external mail on server 2003
    By coolswinger in forum Windows Server 2000/2003
    Replies: 0
    Last Post: 3rd April 2010, 01:10 PM
  2. Replies: 7
    Last Post: 24th March 2010, 03:58 PM
  3. Exchange 2003 - send mail to everyone
    By Ryan in forum Windows
    Replies: 3
    Last Post: 22nd May 2008, 01:57 PM
  4. Can Receive But Cannot Send E-Mail
    By DaveP in forum Wireless Networks
    Replies: 7
    Last Post: 14th November 2007, 08:26 AM
  5. Cannot send mail to SMTP contact
    By meastaugh1 in forum Windows
    Replies: 1
    Last Post: 22nd January 2007, 09:26 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •