我真的很難理解以下問題 - 任何人都可以給我一些關於如何解決這個問題的輸入?我真的在這方面陷入死衚衕。當運行下面的代碼,我得到這個錯誤:致命錯誤:未知的異常'Swift_RfcComplianceException'帶有消息'地址在郵箱給出
Fatal error: Uncaught exception 'Swift_RfcComplianceException' with message 'Address in mailbox given
下面是代碼:
<?php
include_once 'Swift-5.0.3/lib/swift_required.php';
if(isset($_POST['button'])) {
$name = $_POST['name'];
$email = $_POST['email'];
$comments = $_POST['comments'];
$organisation = $_POST['organisation'];
$number = $_POST['number'];
$rec_email = '[email protected]';
$message = "Comments : " . $comments . "<br>" . "organisation: " . $organisation . "<br>" . "Phone Number: " . $number ;
$transport = Swift_MailTransport::newInstance();
$mailer = Swift_Mailer::newInstance($transport);
$message = Swift_Message::newInstance('Subject')
->setFrom($email)
->setTo($rec_email)
->setBody($comments);
$result = $mailer->send($message);
}
?>
這聽起來像'$ _POST ['email']'中的無效電子郵件地址。 –
這已經修復了它,在我的結尾真的很愚蠢的錯誤。非常感謝你 – user3274696
很酷。我已經寫了一個正確的答案。 –