本文介紹了簡單的 PHP 郵件功能在 Amazon 服務器 EC2 上不起作用的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
請查看此代碼
<?php
$to = "someone@example.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
這段代碼有什么問題.它不適用于 Amazon Linux 服務器
what is the problem in this code . Its not working on Amazon Linux server
謝謝
推薦答案
在使用 Php 的 mail()
發送電子郵件時,我遇到了與您相同的問題.安裝發送郵件為我解決了它.
I'd had the same issue as you in sending an email using Php's mail()
. Installing send mail solved it for me.
sudo apt-get install sendmail
這篇關于簡單的 PHP 郵件功能在 Amazon 服務器 EC2 上不起作用的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!