How to insert contents of a logfile to email body

Hi, I wonder if someone could help me with this fab program.

I dont really understand how to use variable's or indeed if i need to use one to acheive my goal.

what im trying to do is get automise to read a log file for example ( c:\test\mylog.log ) and insert the contents of that file into the body of an email.

I have managed without problem to attach the logfile to an email and get automise to fire that off, which works fine.

I presume if I actually want the contents of that logfile to be 'pasted' ( for want of a better word ) into the body of the email rather that just attached i would need to read the file to a variable ?

could any of you kind people explain in simple english ( ish ) how i do that ?

Many thanks

Ben

PS - I have tried to read the helpfile but get totally confused about variables and how to use them

Hi Ben

You can use the Read Text file action to do this. Define a project variable, call it LOGDATA. Then add the Read Text File action, point it to the log file and check the “Put contents into variable” option and select the LOGDATA variable in the list.

Now in your email action, in the message body, you can insert the variable where you want the log file contents, e.g:

Here is the log details :
%LOGDATA%


HTH


Fantastic! Thanks very much Vincent, that was easier that I thought it was - works a treat!

Ok i have another question if you'd be so kind:

I need to telnet to a cisco router at a set time and login and send the comman reload ( to reboot the route )

I have set the telnet action to connet, in the script option I have 2 entry's as follows:

1st line = WaitFor (this is blank), Stript Text (the password for the router) "matt", timeout "2000", enabled (ticked)

2nd line = WaitFor "MoIP-HA#", Script Text "reload", Timeout "2000", Enabled (ticked)

this produces the following in the run log:

STATUS: Connected.
STATUS: Processing Script Item 0
<<
<<
<< User Access Verification
<<
<< Password:
>> matt
STATUS: Processing Script Item 1
STATUS: Waiting [2000ms] for "MoIP-HA#"
<<
<< MoIP-HA#
STATUS: Found "MoIP-HA#"
>> reload
STATUS: Disconnecting.
STATUS: Disconnected.

The router dosen't reboot though as it would if i manually telnet to it, authenticate then type the reload command. Do you know what im doing wrong?

Many thanks again, Get the feeling this software is going to be the best help I've ever had to get routine jobs done automatically ;-)

Aha I have since found that if I try the above manaully ie from windows run command telnet to the router, login and type "reload" the router then gives me the prompt:

Proceed with reload? [confirm]

to which I need to press "y" then enter.

So i presume i need a 3rd line in my script ? such as:

3rd line = WaitFor "Proceed with reload? [confirm]", Script Text "y", Timeout "2000", Enabled (ticked)

Or am i getting this wrong?

If I click the "new" button on the script entry page of the Telnet client options I can fill in the entry above for the 3rd command however when i click "ok" it replaces my 2nd line (WaitFor "MoIP-HA#", Script Text "reload", Timeout "2000", Enabled (ticked)) rather than create a 3rd entry.

Not sure why that is?

Many thanks again - really appreciate your help on this