2017-06-23 5 views
1

ローカルホストからメールを送信しようとしています。私はxamppを使用していますが、「HOST NOT FOUND」という同じエラーが表示されるたびに役立ちます。ここxamppでsmtpサービスを設定する

はここに私のphp.iniファイル

; For Win32 only. 
; http://php.net/smtp 
SMTP=smtp.gmail.com 
; http://php.net/smtp-port 
smtp_port=587 
; For Win32 only. 
http://php.net/sendmail-from 
sendmail_from = [email protected] 

; For Unix only. You may supply arguments as well (default: "sendmail - 
t"). 
; http://php.net/sendmail-path 
sendmail_path ="\"L:\xampp\sendmail\sendmail.exe\" -t" 

; Force the addition of the specified parameters to be passed as extra 
parameters 
; to the sendmail binary. These parameters will always replace the value of 
; the 5th parameter to mail(). 
;mail.force_extra_parameters = 

; Add X-PHP-Originating-Script: that will include uid of the script followed 
by the filename 
mail.add_x_header=off 

はここに私のsendmail.ini

[sendmail] 
smtp_server=smtp.gmail.com 
smtp_port=587 
smtp_ssl=auto 
error_logfile=error.log 
debug_logfile=debug.log 
[email protected] 
auth_password=****** 
[email protected] 
hostname=smtp.gmail.com 

がここ

17/06/23 11:25:06 ** --- MESSAGE BEGIN --- 
17/06/23 11:25:06 ** To: [email protected] 
17/06/23 11:25:06 ** Subject: Test email 
17/06/23 11:25:06 ** From: [email protected] 
17/06/23 11:25:06 ** Reply-To: [email protected] 
17/06/23 11:25:06 ** 
17/06/23 11:25:06 ** Hello World! 
17/06/23 11:25:06 ** 
17/06/23 11:25:06 ** This is my first mail. 
17/06/23 11:25:06 ** --- MESSAGE END --- 
17/06/23 11:25:07 ** Connecting to smtp.gmail.com:587 
17/06/23 11:25:07 ** Disconnected. 
17/06/23 11:25:07 ** Disconnected. 
17/06/23 11:25:07 ** Disconnected. 
17/06/23 11:25:07 ** Socket Error # 11001<EOL>Host not found. 

をDEBUG.LOGされているのは、私は基本的なメールのスクリプトです実行中:

<?php 
$to = '[email protected]'; 
$subject = 'Test email'; 
$message = "Hello World!\n\nThis is my first mail."; 
$headers = "From: [email protected]\r\nReply-To: [email protected]"; 
$mail_sent = @mail($to, $subject, $message, $headers); 
echo $mail_sent ? "Mail sent" : "Mail failed"; 
?> 
+0

あなたの答えを見つけるでしょう。確認してください。 – kodmanyagha

+0

問題がないことを確認してください。 – sampan

+0

誰かが私を助けてください、私のプロジェクトはこれのためだけに停止しています:( – sampan

答えて

関連する問題