SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast atsa's Avatar
    Join Date
    Aug 2008
    Location
    INDIA
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow Help ! to solve problem in Form : charset encoding

    HI friend iam having a typical type of problem.

    When iam sending a mail through my form it show "!" mark somewhere after i hope 220 words, Why this is so, I have tried many times but not successful to remove this exclamation sign from the mail form results in my inbox....

    I think that there is some problem in character encoding but don't know where

    Here is the code for the character encoding

    <?php
    $headers = "MIME-Version: 1.0\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "From:creative_atul@hotmail.com";
    $to="atul@atulthanvi.com";

  2. #2
    SitePoint Guru
    Join Date
    Jan 2005
    Location
    heaven
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you're looking in the wrong place. What makes you think it's the encoding?

  3. #3
    SitePoint Enthusiast atsa's Avatar
    Join Date
    Aug 2008
    Location
    INDIA
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

    this line is the problem i think

    Its creating a ! sign in different places of email results

  4. #4
    SitePoint Guru
    Join Date
    Jan 2005
    Location
    heaven
    Posts
    953
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok, if that's the problem then change the encoding and your done, but I doubt that is the problem. If anything, you are probably sending data in one encoding while sending the email in another encoding. But that still does not explain why you think that's the problem. Intuitions are nice places to start, but they do not build a proof.

  5. #5
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hm, are you sending the html all on a single line?
    The spec sais lines in emails shouldn't be longer than 78 characters, and must not be longer than 998 characters.

    If you're sending a ton of text and html without any new lines, It could be possible that some software somewhere along the path sees your mistake and then adds the break for you, and maybe inserts the '!' character to let you know it tampered with your message at that part. 200 words + some html markups sounds like it could definately exceed 998 characters.

    Consider using a mailing library such as swiftmailer or phpmailer to send your emails with if you aren't overly familiar with the email specs and implementations out there.


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
  •