3

これはかなり簡単なことのようで、私のphpスクリプトは実行できます。しかし、私はメールを受け取っていません。関連するコードは次のとおりです。

php.ini

[mail function]
; For Win32 only.
; http://php.net/smtp
;SMTP = localhost
; http://php.net/smtp-port
;smtp_port = 25

sendmail_path = "C:\xampplite\sendmail\sendmail.exe -t -i"

sendmail.ini

smtp_server=smtp.gmail.com

smtp_port=587
smtp_ssl=auto
default_domain=mydomain.com
error_logfile=error.log
debug_logfile=debug.log
auth_username=username50@gmail.com
auth_password=passpass

force_sender=myemail@gmail.com
hostname=smtp.gmail.com

ここに欠けているものはありますか?私のスクリプトは自分にメールを送信しています。それは問題ではないでしょうか?

<?php
$to = "blah@gmail.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

1 に答える 1

-1

これを試して

sendmail.ini

[センドメール]

smtp_server=smtp.gmail.com
smtp_port=465
smtp_ssl=ssl
error_logfile=error.log
debug_logfile=debug.log
auth_username=[email]@gmail.com
auth_password=[email password]
pop3_server=
pop3_username=
pop3_password=
force_sender=[email]@gmail.com
force_recipient=
hostname=smtp.gmail.com

php.ini

【メール機能】

SMTP = smtp.gmail.com
smtp_port = 465
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
mail.add_x_header=Off
于 2014-04-15T08:05:25.843 に答える