How to Create a Line Break in an Email

One of the most powerful and useful functions in PHP programming and other server-side scripting languages is the ability for the server to send an e-mail message based on the way a user fills out an online form. Figuring out how to format those e-mails is not always easy, so this article explains how to add a vital operation to your automated emails; a line break.

Things You'll Need

  • HTML editor
  • Server with PHP installed
  • Online form with an e-mail function
Show More

Instructions

    • 1

      Find the area of your code where the body of the e-mail is programmed.

    • 2

      Go to the point in the body of the e-mail where you want to enter a line break, and enter "\n" (with the double quotation marks) after the final word you want in the line.

    • 3

      Another option to using the "\n" format is to enter "\x0d\x0a" (still with the double quotation marks). This code performs the same function as "\n" but may work more reliably depending on what version of PHP you have installed on your server.

    • 4

      Enter "\n" or "\x0d\x0a" in each place you want a line break in the email, making sure to include the double quotations around the code each time.

    • 5

      Save your form and test it through a web browser. The e-mail you receive should have entered line breaks at the appropriate places.

Related Searches:

Comments

  • Matt Tacchi Jan 20, 2011
    Great Article thanks!

You May Also Like

Related Ads

Featured