Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


HELP! need contents of text file as body in Email

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1704
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> HELP! need contents of text file as body in Email
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 HELP! need contents of text file as body in Email - 12/15/2004 3:10:46 AM   
  bellpr

 

Posts: 1
Score: 0
Joined: 12/15/2004
From: USA
Status: offline
[V]I am trying to get the contents of a text file to be the body of an E-mail. I am passing the text file names as an argument to the VBS file.

Right now all IÒm getting is the file name as the Body of my E-mail. What I am I missing?

See example below of emailthis.vbs


Set objEmail = CreateObject("CDONTS.NewMail")
objEmail.From = "from addr goes here"

objEmail.To = WScript.Arguments(0)
objEmail.Subject = WScript.Arguments(1)
objEmail.Body = WScript.Arguments(2)
objEmail.AttachFile WScript.Arguments(3)

objEmail.Send

set objEmail = Nothing


Command line calling the VBS looks like this


emailthis.vbs "someone@unknown.com", "this is the subject", "Text file goes here", "attachment"





I need to take arugment #2 which is the text file I want to use, and take the text out of the file (argument2) and make it the body of the E-mail.
 
 
Post #: 1
 
 Re: HELP! need contents of text file as body in Email - 12/15/2004 4:59:25 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
This is the 'lazy way' of creating an email.
You should use FSO to ReadAll from the file and put(read: paste) into the body.


(in reply to bellpr)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> HELP! need contents of text file as body in Email Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts