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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Im new in PHP...Characters in Email subject?

    Hello... I need some help with my PHP email form!
    Everything is working fine but I have Special Characters (, , , , ect.) in the Subject field that dont seem to be appearing, but in the body it appears.
    can anyone help???

    here's my code:

    <?php

    if($_POST['name'] == "") {
    echo "Please Insert Name:";
    } elseif($_POST['email'] == "") {
    echo "Please Insert Email";
    } else {

    if(isset($_POST['submit'])) {
    $to = "
    h.fialho@endbox.com";
    $subject = "Form Solicito Informao";
    $subject2 = " Obrigao";
    $name = $_POST['name'];
    $email = $_POST['email'];

    $headers = "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers .= "From: $email\r\n";
    $headers .= "Reply-To: $email\r\n";

    $headers2 = "MIME-Version: 1.0\r\n";
    $headers2 .= "Content-type: text/html; charset=iso-8859-1\r\n";
    $headers2 .= "From: $to\r\n";
    $headers2 .= "Reply-To: $to\r\n";

    $body = "Name:<br />
    $name\n</p>

    <p>E-mail:<br />
    $email\n</p>";

    $body2 = "<p>Agradecemos o seu interesse.</p>";

    mail($to, $subject, $body, $headers2);
    mail($email, $subject2, $body2, $headers);

    } else {
    echo "blarg!";
    }
    header("Location: thank_you.php");
    }?>

    Thank you however helps...Goodbye

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    try adding a charset to your header:


    PHP Code:
    $header .= 'MIME-Version: 1.0' "\n" 'Content-type: text/plain; charset=UTF-8' 


  •  

    Posting Permissions

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