7

私はローカルホストサーバーにいます。以下のコードを使用していますが、メールを受信して​​いません。

<?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.";
?>
4

2 に答える 2

4

I know its kinda late...

check if your localhost is configured to send email

On ubuntu terminal try executing following command

# apt-get install sendmail
于 2014-11-07T12:05:45.580 に答える
3

php.ini ファイルでメールサーバーが正しく構成されていることを確認してください。

php.ini ファイルで次のようにこれらの行をコメントアウトし、Apache サーバーを再起動します。

/*[mail function]
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
; SMTP = localhost
; smtp_port = 25
*/

/*; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = postmaster@localhost
*/
于 2013-02-10T21:09:36.660 に答える