资料注册后发信小技巧_PHP
程序员文章站
2023-12-26 14:35:57
...
//mail.php
//读信内容
$filename = "wellcom.txt";
$fd = fopen( $filename, "r" );
$contents = fread($fd, filesize($filename));
fclose( $fd );
//替换其中相应内容
$contents=eregi_replace("",$UserName,$contents);
$contents=eregi_replace("",$Password,$contents);
$contents=eregi_replace("",$Url,$contents);
//发信
$to_email=$email;
$from_email="php-java@21cn.com";
$subject="Wellcom!";
$header_info="From:$from_email\nReply-To:$from_email";
$result=@mail($to_email,$subject,$contents,$header_info);
if($result) {
echo "发信成功!";
} else {
echo "发信失败!";
}
?>
//wellcom.txt内容;
您的注册资料为:
用户名:
密码:
欢迎您的到来!
欢迎访问:
//读信内容
$filename = "wellcom.txt";
$fd = fopen( $filename, "r" );
$contents = fread($fd, filesize($filename));
fclose( $fd );
//替换其中相应内容
$contents=eregi_replace("
$contents=eregi_replace("
$contents=eregi_replace("
//发信
$to_email=$email;
$from_email="php-java@21cn.com";
$subject="Wellcom!";
$header_info="From:$from_email\nReply-To:$from_email";
$result=@mail($to_email,$subject,$contents,$header_info);
if($result) {
echo "发信成功!";
} else {
echo "发信失败!";
}
?>
//wellcom.txt内容;
您的注册资料为:
用户名:
密码:
欢迎您的到来!
欢迎访问: