3

メールを送信する必要のあるイントラネットアプリを作成しました(少量)。sendmail組織のSMTPサーバーを使用できなくなるため、またはを介してこれらのメールを送信する必要がありますmail

ただし、電子メールを次のように構成すると、次のようになります。

$config['protocol'] = 'sendmail';

私は得る:

Exit status code: 127
Unable to open a socket to Sendmail. Please check settings.
Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method.

そして私が使うとき:

$config['protocol'] = 'mail';

私は得る:

Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.

PHPでセットアップphpinfo()するか、これを機能させる方法を理解するためにチェックインする必要があるものはありますか?

4

2 に答える 2

10

OK - これは簡単でした。

この問題に直面している人のために:

  1. まず、sendmail (実際には Postfix) がインストールされているかどうかを確認します。Ubuntu 11.x を使用しています。

cd usr/sbin/

  1. sendmail が見つからない場合は、インストールする必要があります
sudo apt-get install postfix
  1. ダイアログのデフォルト オプションを受け入れ、インストールが完了すると、メールは問題なく送信されました。
于 2012-07-25T15:31:14.653 に答える
1

Windows os では、sendmail クラスを試しました。
sendmail.exe、sendmail.ini、および他の 2 つの .dll ファイルを内部に配置する必要があります。

C:\wamp\sendmail

gmail サーバー用に sendmail.ini ファイルを次のように構成します。

[sendmail]

smtp_server=smtp.gmail.com
smtp_port=587
smtp_ssl=tls
error_logfile=error.log
debug_logfile=debug.log
auth_username=mymail@gmail.com
auth_password=mypassword
hostname=smtp.gmail.com

次に、内部で利用可能なphp.iniファイルを編集します

C:\wamp\bin\apache\Apache2.2.17\bin

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

プロジェクトを実行して、次のログ ファイルを参照してください。

C:\wamp\sendmail\error.log C:\wamp\sendmail\debug.log

私はこの投稿があなたを助けることができると思います..

于 2013-08-09T15:43:25.543 に答える