Home >Backend Development >PHP Tutorial >Tips for sending emails after registering information_PHP tutorial

Tips for sending emails after registering information_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 16:06:38833browse

//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...
Statement:
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