【发布时间】:2018-05-21 02:36:52
【问题描述】:
例如,我只希望发件人的电子邮件来自“anything@abc.com”,如果不允许其他电子邮件如“anything@cde.com”,则只允许@abc.com。我该怎么做?
假设 $_POST['Sender']="anything@abc.com";
$to = "someone@example.com"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $from = $_POST['Sender']; $headers = "From:" . $from; mail($to,$subject,$message,$headers); echo "Mail Sent.";
【问题讨论】: