0

誰でも私を助けることができますか?私はPHPmail()関数で立ち往生しています.私はすでに設定php.iniしていsendmail.iniます. 関数を使用しているだけで、機能mail($to,$subject,$content)しませんでした。localhost XAMPP を使用しています。

このphp.iniファイル:

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

; For Win32 only.
; http://php.net/sendmail-from
sendmail_from = jesus4way@yahoo.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = "\"C:\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(), even in safe mode.
;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

; Log all mail() calls including the full path of the script, line #, to address and headers
;mail.log = "C:\xampp\apache\logs\php_mail.log"
4

1 に答える 1

0

サーバーのステータスを確認する

  • XAMPPコントロールパネルからMercuryMailServerを起動します。ステータスが。であるかどうかを確認しますRunning
  • Mercuryコントロールパネル(XAMPPパネルまたはタスクバーから)を開き、SMTPサーバーのステータスが。であるかどうかを確認しますReady
  • Mercuryコントロールパネルから自分の電子メールアドレスにメールメッセージを送信し、失敗するかどうかを確認します。

PHP

エラー報告を許可する:error_reporting(E_ALL);PHPのエラーと警告を確認します。

mail()関数にヘッダー情報を追加してみてください。

<?php
$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
于 2013-02-15T08:22:11.880 に答える