...

View Full Version : carriage return regardless



hughesmi
10-20-2007, 11:36 AM
This question has been asked before, that I am sure. I have a simple form that sends e-mail via JMAIL. This all works fine.

However, I need the textarea to pick up on a carriage return regardless of the user hitting return or not.

The reason why I needs this, when I received my email the “message” seems to all in one line.

SouthwaterDave
10-20-2007, 12:41 PM
What format is your email sent in? HTML or plain text? If HTML then line ends will be "lost".

There may also be a Windows/Unix issue. Windows applications usually recognise a carriage return (CR) plus a line feed (LF) as end of line. Unix applications only expect one of these. A CR, I think. Thus an email sent from a Unix computer may have lost its line ends when viewed in a Windows computer.

If you are using HTML format, I suggest you translate each CR into a <br> tage and throw away all LFs. If you are using plain text, then translate all CRs (but not CRLFs as this could result in CRLFLFs) into CRLFs.

hughesmi
10-20-2007, 01:09 PM
Ah, it is sent in HTML. Do you think this would do it?

Response.Write( "Messgae: <pre>" & JMail.Log & "</pre>" & vbcrlf )


Mike

SouthwaterDave
10-20-2007, 04:40 PM
I'm not sure now if I understood your original question. Are you saying that you have a page that sends an email successfully and you now have another page to display an incoming email? And it is this page that displays the email with no line breaks.

My next question is what value does JMail.Log actually contain? If it contains plain text with line breaks then try this:

Response.Write("<p>Message:</p>")

msg = JMail.Log
msg = Replace(msg, vbCrLf, "<br>")
msg = Replace(msg, vbCr, "<br>")
msg = Replace(msg, vbLf, "<br>")
Reponse.Write(msg)

hughesmi
10-20-2007, 05:47 PM
Thanks for your help. This is what my code looks like. The bold line is what I am trying to get to return.



JMail.body = JMail.body &"An e-mail enquiry has been made from on the " & FormatDateTime(Now(),1) & " "
JMail.body = JMail.body &"<BR>"
JMail.body = JMail.body &"<BR>"
JMail.body = JMail.body &"Below is a summary of the email details."
JMail.body = JMail.body &"<HR>"
JMail.body = JMail.body &"Contact Name :" & request.form("Full_Name")
JMail.body = JMail.body &"<BR>"
JMail.body = JMail.body &"Reason For Emailing :"& Request.form("reason_for_email")
JMail.body = JMail.body &"<BR>"
JMail.body = JMail.body &"Date Required:"& Request.form("hire_date")
JMail.body = JMail.body &"<BR>"
JMail.body = JMail.body &"Contact Email Address :"& Request.form("Email_Address")
JMail.body = JMail.body &"<BR>"
JMail.body = JMail.body &"Contact Phone Number :"& Request.form("tel_number")
JMail.body = JMail.body &"<BR>"

'JMail.body = JMail.body &"Message :"& Request.form("message")

JMail.body = JMail.body &"Messgae: <pre>" & message & "</pre>" & vbCr

JMail.body = JMail.body &"<BR>"
JMail.body = JMail.body &"Referral :"& Request.form("Market_Referrer")
JMail.body = JMail.body &"<HR>"
JMail.body = JMail.body &"User IP Address:"& Request.Servervariables("LOCAL_ADDR")
JMail.body = JMail.body &"<BR>"
JMail.body = JMail.body &"Server IP Address:"& Request.ServerVariables("REMOTE_HOST")
JMail.body = JMail.body &"<BR>"
JMail.body = JMail.body &"</BODY></HTML>"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum