String value not being retreived

I have an agent in an mail-in-database , which runs ‘before new mail is arrived’ when the email arrives the agent tries to extract the value. Which is not happening.

The same code when run manually agent extracts the value, from the text in the email that is arrived at the mail-in-database.

The code is like this…

SR = Trim(Strleft(Strright(bodyTxt, “[CustomerRefNumber]” & Chr$(13) & Chr$(10)), Chr$(13) & Chr$(10)))

and the text in the body of the incoming email is like this…

some text here…

[CustomerRefNumber]

KH-11361558

…and some other text…

The agent is trying to extract value “KH-11361558”.

Can any body help me pls, why the agent (run automatically, when the email is recieved ?) is not extracting the value.

Thanks

Raj

Subject: RE: string value not being retreived.

This may be a OS difference in how the server represents linefeed characters versus your workstation.

Suggest you use the DebugStr function to check what the exact value you’re getting is.

Subject: RE: string value not being retreived.

Thanks Andre for your response. I will try out the DebugStr.

Thanks again.,

Raj

Subject: RE: string value not being retreived.

Hi Andre,

I Am still getting the value as “” or null, after I used the DebugStr function that you pointed to me.

Do you see any other reason why this is happening ?

Thanks

Raj

Subject: RE: string value not being retreived.

This may be a OS difference in how the server represents linefeed characters versus your workstation. Specifically, on the server your Body text may use just LF instead of CRLF to represent a linefeed. So the string you are searching for does not occur.

I meant that you should use Debugstr to check the value in bodyTxt to see what line delimiters it contains.