Tips for sending emails after registering information_PHP tutorial

WBOY
Release: 2016-07-21 16:06:38
Original
752 people have browsed it

//mail.php
//Read the content of the letter
$filename = "wellcom.txt";
$fd = fopen( $filename, "r" );
$contents = fread($fd, filesize($filename));
fclose( $fd );

//Replace the corresponding content
$contents=eregi_replace(" ",$UserName,$contents);
$contents=eregi_replace("",$Password,$contents);
$contents=eregi_replace("",$Url,$ contents);

//Send an email
$to_email=$email;
$from_email="php-java@21cn.com";
$subject="Wellcom!";
$header_info="From:$from_emailnReply-To:$from_email";
$result=@mail($to_email,$subject,$contents,$header_info);
if($result) {
echo "Send message successfully!";
} else {
echo "Send message failed!";
}
?>

//wellcom.txt content;
Your registration information is:
Username:
Password:

Welcome!

Welcome to:

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/315383.htmlTechArticle?php //mail.php //Read the content of the letter $filename = wellcom.txt; $fd = fopen( $filename, r ); $contents = fread($fd, filesize($filename)); fclose( $fd ); //Replace the corresponding content $contents...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!