簡體   English   中英

如何通過php和xampp localhost發送電子郵件?

[英]How to send an email by php and xampp localhost?

我的服務器端文件有問題

我嘗試發送電子郵件,但在郵箱中沒有找到任何內容

<?
$from = 'faresbenslama95@gmail.com';
$to_email = 'faresbenslama95@gmail.com';
$subject = 'Testing PHP Mail';
$message = 'This mail is sent using the PHP mail function';
$headers  = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "From: " . $from . "\r\n";
$headers .= "Reply-To: " . $from . "\r\n";
$headers .= "X-Mailer: PHP/" . phpversion();
$headers .= "X-Priority: 1" . "\r\n";
mail('faresbenslama95@gmail.com', $subject, $message, $headers);
?>

我希望收到電子郵件,但未收到任何消息。

您是否錯過了剛開始時提出的php或僅顯示了示例。 該代碼似乎很好

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM