SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast laresistance2's Avatar
    Join Date
    May 2011
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Headers MIME Email Issue

    Hello,
    I have two questions about the headers to mail PHP function

    1) For the encoding, I would like to know whether to put guillement between the type of encoding or nothing put
    Example:
    Code:
    "Content-Type: text/plain; charset=\"utf-8\"\r\n";
    OR
    Code:
    "Content-Type: text/plain; charset=utf-8\r\n";
    2) It seems that the last line of the header need not contain the space character ("\n")
    Is this true?

    Thanks!

  2. #2
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,169
    Mentioned
    153 Post(s)
    Tagged
    0 Thread(s)
    1) The quotes around utf-8 are definitely optional, I personally use the quotes because I like to have them in case the variable I used for encoding contains a space.
    2) Yes, you technically do not need the \r\n for the last header line, granted, again I usually keep it in case I add additional headers in the future.

  3. #3
    SitePoint Enthusiast laresistance2's Avatar
    Join Date
    May 2011
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay,
    So,
    1) I do not necessarily have to put quotes around the type of encoding (necessary only when there are spaces).
    2) The space in the last line of the header is optional.

    Thank you cpradio!


Tags for this Thread

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
  •