Comma, ReadFile and SMTPSendMail

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
Rory
Pro Scripter
Posts: 50
Joined: Thu Mar 23, 2006 2:50 pm
Location: Wisconsin

Comma, ReadFile and SMTPSendMail

Post by Rory » Tue Dec 04, 2007 10:17 pm

I am working with the ReadFile command and have experienced a problem when the data retrieved contains a comma. I am sending the data as a variable representing the body of the e-mail with SMTPSendMail.

This is the first line of text in the file being read: Created and sent on Tuesday, December 04, 2007 4:13 PM

What is actually sent is the following: Created and sent on Tuesday

Why is all the data after the first comma dropped?

Thanks,
Rory

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Dec 04, 2007 10:46 pm

Please send your code. Then we might be able to help.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Rory
Pro Scripter
Posts: 50
Joined: Thu Mar 23, 2006 2:50 pm
Location: Wisconsin

Post by Rory » Tue Dec 04, 2007 10:54 pm

Well I seem to have fixed it myself. I had been putting the % around all variables in the SMTPSendMail line of code. Once I removed them, the problem went away.

Rory

rblack
Pro Scripter
Posts: 87
Joined: Sat Dec 22, 2007 12:39 pm

Post by rblack » Sat Dec 29, 2007 12:19 pm

well, i have also a problem with readfile in which there are a lot of commas ( , ) and other "ugly" characters like [{?>IEAuto.dll,hIE

ReadFile>data.csv,data

LibFunc>hIE,Navigate,r,%IE[0]%,http://mypage.com/dataobtain.php
LibFunc>hIE,WaitIE,r,%IE[0]%
Wait>3

Let>FieldName={"who"}
Let>FieldValue=me
LibFunc>hIE,FormFill,r,%IE[0]%,,bform,str:FieldName,str:FieldValue,0

Let>FieldName={"content"}
//Press TAB*4
//send>data
PutClipBoard>%data%
GetClipBoard>data2
LibFunc>hIE,FormFill,r,%IE[0]%,,bform,str:FieldName,str:data2,0

//**********************
In desperation i tried to put the data to clipboard and then send it. It made the script work sometime, but i need the script to work with 100% efficency, not once per several times.

In the code version above:
+ the "who" field is always filled properly
- the "content" field is fille properly once per 3 runs (and i am 100% sure the page loads completely because there is no graphic on the page)

I tried several ways to fill the form:
1) The following code send about 300 lines, and then opens a new IE window and crashes:

Press TAB*4
send>data

2) The following evolution ;) make access violation and other errors:
LibFunc>hIE,FormFill,r,%IE[0]%,,bform,str:FieldName,str:data2,1

3) This commands doesnt do anything, send data correct, or crash macro sheduller (its random):
LibFunc>hIE,FormFill,r,%IE[0]%,,bform,str:FieldName,data2,0
LibFunc>hIE,FormFill,r,%IE[0]%,,bform,str:FieldName,data,0

4) The following commands send data until the first encountered comma:
LibFunc>hIE,FormFill,r,%IE[0]%,,bform,str:FieldName,%data%,0
LibFunc>hIE,FormFill,r,%IE[0]%,,bform,str:FieldName,%data2%,0

OH NO! Something has gone wrong, macro scheduler crashed and all the code in my script has been deleted, does macro scheduler do any temporary backup of scripts???

rblack
Pro Scripter
Posts: 87
Joined: Sat Dec 22, 2007 12:39 pm

Post by rblack » Sat Dec 29, 2007 1:46 pm

the following code works fine:

ReadFile>data.csv,data
PutClipBoard>data
Press Tab*4
Press CTRL
send>v
Release CTRL

But i dont think its the best solution. Why does the fillform function not work?

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Dec 29, 2007 4:38 pm

>Why does the fillform function not work?

Without access to the page in question I cannot answer that - are you able to provide the URL of the page in question and which fields you want filled?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

rblack
Pro Scripter
Posts: 87
Joined: Sat Dec 22, 2007 12:39 pm

Post by rblack » Sun Dec 30, 2007 10:46 am

Thats the whole source (from html side) of getdata.php file to which i send statistic data:


p:

south
north
west
east
middle-east
asia
europe
america





Looks simple

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sun Dec 30, 2007 12:08 pm

None of the fields have names. So there is no way to reference them.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

rblack
Pro Scripter
Posts: 87
Joined: Sat Dec 22, 2007 12:39 pm

Post by rblack » Sun Dec 30, 2007 3:26 pm

well actually all the fields have names, but i cannot paste it in this forum ( itried, but it seems you have some kind of protection).

Hopefully copying from clippoard works on my form ;)

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts