Dynamic Web technology php write mail function considerations

Source: Internet
Author: User
Tags mail php write win32

Read a book today, see mail function, I practiced to write a simple program.

<?php
$tomail = ' webmaster@webjx.com ';
$name = ' WEBJX ';
$text = ' webjx.com is a very good web!! ';
if (Mail ($tomail, $name, $text))//function has 5 parameters The first 3 are required parameters. The first parameter represents the destination address, the second argument is the theme, and the third parameter represents the content.
{
echo ' OK ';
}
Else
{
Echo ' no ';
}
?>

Note that the use of the mail function needs to be configured inside the php.ini.

[Mail Function]
; For Win32.
SMTP = localhost
Smtp_port = 25
; For Win32.
; sendmail_from = me@example.com

After configuration

[Mail Function]
; For Win32.
SMTP = smtp.tom.com//Specify your mailbox SMTP
Smtp_port = 25
; For Win32.
Sendmail_from = webmaster@webjx.com//The mailbox you are using

When configured, remember to restart Apache!

But really strange, in the unit to send a successful, write the same at home did not succeed, everyone to see ~ ~



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.