Questions about [PHP Mail]

Source: Internet
Author: User
Hello everyone, I recently learned about PHP. I want to ask you a question about sending an email using PHP. I use Windows. Php. [mail & nbsp; function]; & nbsp; For & nbsp; Win32 & nbsp; only. SMTP & nbsp; = & nbs questions about [PHP Mail]
Hello everyone, I recently learned PHP by myself. I have a question about using PHP to send emails.
I use Windows.

Php. ini is set as follows:
[Mail function]
; For Win32 only.
SMTP = smtp.163.com
Smtp_port = 25
; For Win32 only.
Sendmail_from = red_song@163.com

The script for sending the email is:
$ Msg = "OK? \ N ";
$ Recipient = "57295374@qq.com ";
$ Subject = "Form Submission Results ";
$ Mailheaders = "From: My Web Site \ n ";
$ Mailheaders. = "Reply-To:". $ _ POST ["email"];
Mail ($ recipient, $ subject, $ msg, $ mailheaders );

However, emails cannot be sent all the time. please help me solve the problem. Is there anything wrong with smtp?
------ Solution --------------------
The mail function can only be used on sender servers without user authentication.
While smtp.163.com requires user authentication, that is, after logging on

You can use the phpmailer tool class to send emails.
------ Solution --------------------
Reference:
How can I use the mail function provided by php?

You must configure service parameters in apache httd. conf.

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.