Я не уверен, что вы используете Windows 8, но если вы это сделаете, вы должны сделать следующее:
1) В PHP.ini сделайте так, чтобы часть электронной почты выглядела так
; XAMPP: Comment out this if you want to work with an SMTP Server like Mercury
SMTP = localhost
smtp_port = 465
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from =
; XAMPP IMPORTANT NOTE (1): If XAMPP is installed in a base directory with spaces (e.g. c:\program filesC:\xampp) fakemail and mailtodisk do not work correctly.
; XAMPP IMPORTANT NOTE (2): In this case please copy the sendmail or mailtodisk folder in your root folder (e.g. C:\sendmail) and use this for sendmail_path.
; XAMPP: Comment out this if you want to work with fakemail for forwarding to your mailbox (sendmail.exe in the sendmail folder)
sendmail_path = "C:\xampp\sendmail\sendmail.exe -t"
; XAMPP: Comment out this if you want to work with mailToDisk, It writes all mails in the C:\xampp\mailoutput folder
;sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe"
; 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=on
2) Сделайте так, чтобы smtp-часть sendmail.ini выглядела так
smtp_server=localhost
; smtp port (normally 25)
smtp_port=25
; SMTPS (SSL) support
; auto = use SSL for port 465, otherwise try to use TLS
; ssl = alway use SSL
; tls = always use TLS
; none = never try to use SSL
smtp_ssl=none
; if your smtp server requires authentication, modify the following two lines
[email protected]
auth_password=password
3 ) Загрузите Stunnel https://www.stunnel.org/downloads.html и выполните следующие действия. изменения в stunnel.conf. Stunnel работает в трее, каждый раз, когда вы вносите изменения, щелкните правой кнопкой мыши значок Stunnel и перезагрузите файл конфигурации.
cert = stunnel.pem
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
key = stunnel.pem
[ssmtp]
accept = 465
connect = 25
[gmail-smtp]
client = yes
accept = 127.0.0.1:25
connect = smtp.gmail.com:465
; To check logs you can enable logging using following lines
debug = 7
4 ) Перейдите в папку Sendmail, щелкните правой кнопкой мыши sendmail.exe -> Свойства -> Совместимость -> Нажмите кнопку Внести изменения для всех пользователей -> Выберите совместимость с Windows XP (Service Pack 3) и установите флажок Запуск от имени администратора.
5) Всегда запускайте XAMPP от имени администратора!!
Это необходимо только в Windows 8+ (например, в Windows 2008 R2 мне нужно было только правильно настроить sendmail на gmail, и все заработало).
person
Foxhoundn
schedule
18.02.2015
sendmail_path
. Мне это кажется неправильным. - person Nathan Tuggy   schedule 16.02.2015