Solve the problem that PHP. ini emails in windows are correctly configured and do not send emails.

Source: Internet
Author: User

Warning: Mail () [function. Mail]: SMTP Server Response: 530 5.7.0 must issue a starttls command first

The PHP mail () function is not available in windows. You need to install Sendmail.
1. Download sendmail.zip from http://glob.com.au/sendmail/
2. decompress the package to C:, for example, C: \ PHP \ sendmail. It is best to use a short path and a long path name may cause problems.
3. Modify PHP. ini as follows:
Sendmail_path = "C: \ Wamp \ Sendmail \ sendmail.exe-t"

4. Modify sendmail. ini according to your configuration environment.
It is best to enable Debug. LOG_FILE and error_logfile for the first time to check whether Sendmail takes effect.
5. Restart Apache to use sendmail with other SMTP servers, such as smtp.163.com, to send emails. Currently, most mailboxes require SMTP authentication. Therefore, you must add the user name and password to sendmail. ini.

PHP. ini configuration (take the 163 mailbox as an example)

[Mail function]
; For Win32 only.
SMTP = smtp.163.com
Smtp_port = 25
; For Win32 ......

Use sendmail with other SMTP servers, such as smtp.163.com, to send emails. Currently, most mailboxes require SMTP authentication. Therefore, you must add the user name and password to sendmail. ini.

PHP. ini configuration (take the 163 mailbox as an example)

[Mail function]
; For Win32 only.
SMTP = smtp.163.com
Smtp_port = 25
; For Win32 only.
Sendmail_from = 4u4v@163.com
; For Unix only. You may supply arguments as well (default: "sendmail-t-I ").
Sendmail_path = "D: \ XAMPP \ Sendmail \ sendmail.exe-t"

Configure SMTP, smtp_port, and sendmail_path.

Sendmail. ini configuration

[Sendmail]
; You must change mail.mydomain.com to your SMTP Server
Smtp_server = smtp.163.com
Smtp_port = 25
Auth_username = yourusername
Auth_password = yourpassword
Force_sender = yourusername@163.com

Sendmail is available online. If you use XAMPP, it will be included directly.

At the same time, add this sentence to the conf of the VM.

Php_admin_value sendmail_path 'd: \ XAMPP \ Sendmail \ sendmail.exe-T 4u4v@163.com'

This email address is the user's email address.

Http://s.yanghao.org/program/viewdetail.php? I = 39709.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.