SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Line Breaks in an E-mail Form

    Is it possible to create line breaks in a form? All of my informations appears as follows:

    This mail message was sent from the www.ccbwebdesigns.com Online Form Email: First Name: John Last Name: Doe Business Type: Anonymous Business Name: In the Dark Phone: 555-GHOSTLY Mail: casper@haunted.com

    I would like a line break after each individual text field.

    Here is my ASP code.

    Mailer.BodyText = strMsgHeader & vbCrLf & "Email: " & Request.Form("Email") & _
    vbCrLf & "First Name: " & Request.Form("FirstName") & _
    vbCrLf & "Last Name: " & Request.Form("LastName") & _
    vbCrLf & "Business Type: " & Request.Form("BusinessType") & _
    vbCrLf & "Business Name: " & Request.Form("BusinessName") & _
    vbCrLf & "Phone: " & Request.Form("Phone") & _
    vbCrLf & "Mail: " & Request.Form("Mail")
    Last edited by ccraigbrown; Sep 26, 2006 at 05:55. Reason: Extra word

  2. #2
    SitePoint Zealot
    Join Date
    Aug 2006
    Location
    NY, USA
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is pretty easy, just use CHR(13) << Line break as long as you're not sending in HTML format you're all set.

    Code:
    Mailer.BodyText = strMsgHeader & vbCrLf & "Email: " & Request.Form("Email") & Chr(13) & _
    vbCrLf & "First Name: " & Request.Form("FirstName") & Chr(13) & _
    vbCrLf & "Last Name: " & Request.Form("LastName") & Chr(13) & _
    vbCrLf & "Business Type: " & Request.Form("BusinessType") & Chr(13) & _
    vbCrLf & "Business Name: " & Request.Form("BusinessName") & Chr(13) & _
    vbCrLf & "Phone: " & Request.Form("Phone") & Chr(13) & _
    vbCrLf & "Mail: " & Request.Form("Mail")
    Enjoy

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2006
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is an html form. I tried to add breaks at the end of each line but it just produces and error message.

  4. #4
    Original Gangster silver trophy Thing's Avatar
    Join Date
    Oct 2000
    Location
    Philadelphia, PA
    Posts
    4,708
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    If its HTML then just use HTML:

    Code:
    Mailer.BodyText = strMsgHeader & vbCrLf & "Email: " & Request.Form("Email") & _
    "<BR>" & "First Name: " & Request.Form("FirstName") & _
    "<BR>" & "Last Name: " & Request.Form("LastName") & _
    "<BR>" & "Business Type: " & Request.Form("BusinessType") & _
    "<BR>" & "Business Name: " & Request.Form("BusinessName") & _
    "<BR>" & "Phone: " & Request.Form("Phone") & _
    "<BR>" & "Mail: " & Request.Form("Mail")

  5. #5
    SitePoint Zealot
    Join Date
    Aug 2006
    Location
    NY, USA
    Posts
    141
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep, in HTML form you have to use <br> instead of Chr(13)....


Bookmarks

Posting Permissions

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