Page 1 of 1 1
Topic Options
#31238 - 2002-10-23 02:13 PM Pass a String to Postie
funkester Offline
Fresh Scripter

Registered: 2002-10-21
Posts: 12
Hi,

Please can someone help me. I am trying to pass a string to postie so I can email the string contents to myself. The string contains multiple lines of data.
When the email is received the message body only contains the first word of the first line of the string.

When I view the contents of the string onscreen, it displays correctly and looks like this:

Not Installed to Machine1
Not Installed to Machine2
Not Installed to Machine3

But the contents of the email looks like this:

Not

The code I have been working with is this:

code:
 ; **************************************************************
; *** Read contents of File to String ***

$string=""
open(1,"notinst.ini")
$line=readline(1)
while @ERROR=0
$string=$string+$line + Chr(13) + Chr(10)
$line=readline(1)
loop
$null=close(1)

; **************************************************************
; *** Email String to Admin ***

; E-Mail Addresses of Administrators
$email1 = "greg@@test.com"
$email2 = "parkerm@@test.com"
$email3 = "someone@@whocare.nl"

Shell "postie.exe -host:192.168.4.129 -to:$email1 -from:@userid@@@wksta -s:SU_Not_Installed_to... -msg:$string"

Thanks in advance.

Kind Regards, Greg.

Top
#31239 - 2002-10-23 02:32 PM Re: Pass a String to Postie
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
You need to wrap the message in quotes. Not sure how postie will deal with the carriage lines though.

A better way of doing it is to write the message to a file, and send the file. Using "RedirectOutput" is a simple way of doing this.

To get your string in quotes, try:
code:
Shell 'postie.exe -host:192.168.4.129 -to:$email1 -from:@userid@@@wksta -s:SU_Not_Installed_to... -msg:"$string"'


Top
#31240 - 2002-10-23 02:56 PM Re: Pass a String to Postie
funkester Offline
Fresh Scripter

Registered: 2002-10-21
Posts: 12
Cheers Richard,

Your way worked perfectly. Thanks again. :-)

Greg

Top
#31241 - 2002-10-23 03:12 PM Re: Pass a String to Postie
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Please also read Proper use of quotes or use any of the email UDFs posted in the UDF Forum.
_________________________
There are two types of vessels, submarines and targets.

Top
#31242 - 2002-10-23 03:22 PM Re: Pass a String to Postie
funkester Offline
Fresh Scripter

Registered: 2002-10-21
Posts: 12
Thanks Jens, I had my "" and my '' the wrong way round !!!

Kind Regards, Greg

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 373 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.054 seconds in which 0.025 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org