PHP mail()不发送电子邮件 - 某处出现小错误

时间:2016-01-13 19:47:56

标签: php email

我无法在代码中看到错误 - if语句回应' no'但所有变量都是正确的

$to = 'mail@mail.com';
  $subject = $job.' - '.fetchtitle();
  $message = 'Name: '.$_POST['fname'].' '. $_POST['surname'].'<p>
              Address: '. $_POST['address'].', '. $_POST['city'].', '. $_POST['postcode'].'<p>
              Phone: '. $_POST['phone'].'<p>
              Email: '. $_POST['email'].'<p>
              Cover Letter: '. $_POST['covletter'];

  mail($to, $subject, $message);
  if(mail($to, $subject, $message))
    echo 'Sent!';
  else echo 'no';

0 个答案:

没有答案