Forum Moderators: coopster & phranque

Message Too Old, No Replies

Formating a text file using asp, php or any other language

         

fintan

2:13 pm on Dec 17, 2002 (gmt 0)

10+ Year Member



Hi I was wondering is it possible to format a text file
using any scripting language or even basic html. I ask because I'm giving the option on the my helpdesk to email a client, informing him/her of the progress of a call.

What the email client spits out is
Call logged on the 17/12/2002 12:38:02 By Paul Brennan Description: probs with citrix connection, he has updated most machines in sligo and they are fine but one can't find client Click on this link to check the status of your call http:\\LINK Username=clientname@emailaddress.ie Password=9807 Or you can contact me at such & such

What I want is
Call logged on the 17/12/2002 12:38:02
By Paul Brennan

Description: probs with citrix connection, he has updated most machines in sligo and they are fine but one can't find client

Click on this link to check the status of your call http:\\LINK

Username=clientname@emailaddress.ie
Password=9807

Or you can contact me at such & such

I have been banging my head against a wall trying to get this to work. Thanks

jatar_k

6:53 pm on Dec 17, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



What generates the email that you want to format? Is it a program? I seem to be missing the ins and outs of how the email is generated and where the formatting could be plugged in.

toadhall

7:49 pm on Dec 17, 2002 (gmt 0)

10+ Year Member



Hi fintan,

Usually this is all it takes:

\n = newline
\n\n = whitespace

...so:

Call logged on the 17/12/2002 12:38:02\nBy Paul Brennan\n\nDescription: probs with citrix connection, he has updated most machines in sligo and they are fine but one can't find client\n\nClick on this link to check the status of your call\n\nhttp:\\LINK Username=clientname@emailaddress.ie\nPassword=9807\n\nOr you can contact me at such & such\n

...but if it's running on a Windows machine then the newline needs a carriage return added to it:

\r\n = new line

T

fintan

9:13 am on Dec 18, 2002 (gmt 0)

10+ Year Member



All it is a html mailto in a "a href" with Subject, cc & body. But the content is done dynamicly though asp. Its the body that I have been trying to format. I was thinking of using an include but the same problem occurs. I tried using chr(13) for a return but it doesn't like it. All I need is some code that says after every 7th word put in a line break or some such.

I'm running asp though chillisoft on a linux box. Also php is running on it. So I have a choice of language in which to use.

jatar_k

4:22 pm on Dec 18, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Where the body of the email is constructed then you can just add \n or \r\n as toadhall suggested.

You will have to locate the part of the mailer script that puts the body together to see how it is building it and what options are available. Otherwise you will have to change the way it is constructing the body of the email to allow for formatting.

toadhall

6:05 pm on Dec 18, 2002 (gmt 0)

10+ Year Member



You could try PHP's wordwrap() [php.net] function, but that wouldn't provide the whitespace. You'd have to add the \n\n in the script that puts the data together.

T