Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    UK
    Posts
    302
    Thanks
    16
    Thanked 0 Times in 0 Posts

    Internet Explorer carriage return regardless

    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.
    Kind regards,
    Mike Hughes

  • #2
    Regular Coder
    Join Date
    May 2007
    Location
    UK
    Posts
    180
    Thanks
    0
    Thanked 18 Times in 18 Posts
    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.

  • #3
    Regular Coder
    Join Date
    Jul 2002
    Location
    UK
    Posts
    302
    Thanks
    16
    Thanked 0 Times in 0 Posts
    Ah, it is sent in HTML. Do you think this would do it?

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


    Mike
    Kind regards,
    Mike Hughes

  • #4
    Regular Coder
    Join Date
    May 2007
    Location
    UK
    Posts
    180
    Thanks
    0
    Thanked 18 Times in 18 Posts
    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)

  • #5
    Regular Coder
    Join Date
    Jul 2002
    Location
    UK
    Posts
    302
    Thanks
    16
    Thanked 0 Times in 0 Posts
    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>"
    Last edited by hughesmi; 10-20-2007 at 06:51 PM.
    Kind regards,
    Mike Hughes


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •