PHP sends mail in mail or pear mail (window/linux)

Source: Internet
Author: User
Tags glob pear win32


First, Windows SendMail

http://glob.com.au/sendmail/

Second, Windows SMTP server


Http://msdn.microsoft.com/zh-cn/library/8b83ac7t (v=vs.80). aspx

Troubleshoot WIN7 SMTP installation Issues
Some say the WIN7 system doesn't have an SMTP service.
The specific installation steps are as follows:
Control Panel/program > Turn on and off Windows features

Internet Information Services will be the World Wide Web Service > Application Development feature. NET extensibility hook on the installation is OK

To help you out, thank you.


The PHP mail () function is not available in Windows


The PHP mail () function is not available in Windows and requires installation of SendMail.

Warning:mail () [Function.mail]: "Sendmail_from" not set in php.ini or custom ' from: ' Header missing in
1. Download from http://glob.com.au/sendmail/Sendmail.zip
2. Extract to C: Under, such as C:/php/sendmail, the best short path, long path name may cause problems.
3. Modify PHP.ini as follows
Sendmail_path = "C:/php/sendmail/sendmail.exe-t"
4. Modify the Sendmail.ini according to your own configuration environment.
It is a good idea to enable debug.log_file,error_logfile for the first time to see if SendMail is active.
5. Restart Apache


Use SendMail in conjunction with other SMTP servers, such as smtp.airmb.com, to implement e-mail messages. Most mailboxes now require SMTP authentication, so add a username and password to the Sendmail.ini.

PHP.ini configuration (take airmb.com mailbox as an example)

[Mail Function]
; For Win32.
SMTP = smtp.airmb.com
Smtp_port = 25
; For Win32.
Sendmail_from = facai@airmb.com
; For Unix only. You may supply arguments as OK (default: "Sendmail-t-i").
Sendmail_path = "C:/php/sendmail/sendmail.exe-t"

Configure three items, SMTP, Smtp_port, and Sendmail_path

Sendmail.ini Configuration

[SendMail]
; Must change mail.mydomain.com to your SMTP server
Smtp_server=smtp.airmb.com
Smtp_port=25
Auth_username=yourusername
Auth_password=yourpassword
Force_sender=facai@airmb.com
; Default_domain=mydomain.com


At the same time in the virtual host of the Conf add such a sentence

Php_admin_value sendmail_path ' c:/php/sendmail/sendmail.exe-t facai@airmb.com '

This email address is for the user's e-mail address, just Add.

Attention

After testing, the results are as follows: sent successfully, indicating that it has been sent to the mail server queue but! But the mail server did not start!

Running: Service SendMail start

In addition, a successful message has been sent and the SendMail server will be saved! When the mail server is started, all unsent send

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.