Home > Backend Development > PHP Tutorial > 很实用的一个完整email发送程序_PHP

很实用的一个完整email发送程序_PHP

WBOY
Release: 2016-06-01 12:40:25
Original
1105 people have browsed it

很实用的一个完整email发送程序,很简单,把下列代码复制到一个空白文本页面,如index.php,运行就行了。具体实例:http://zsvalley.uhome.net/email/index.php。
以下是完整的源代码:(有任何问题请email:zsvalley@cmmail.com)



if ($ok=='yes'){
//        SetCookie("yname", $yname);  
//        SetCookie("yemail", $yemail);  

        if (!eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3}$",$yemail)){
             
            echo "请正确填写您的EMAIL地址! 返回";
         
        }elseif(!eregi("^[_.0-9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3}$",$femail)){
         
            echo "请正确填写您好友的EMAIL地址! 返回";

        }else{

            $message=$fname.",你好:nn你的朋友".$yname."特地来信想对向您说:n-----------------------------------n".$comments."n-----------------------------------nnn提供服务:http://zsvalley.uhome.net/email/nn◆◆◆ valley网络无界限  http://valley.coc.cc ◆◆◆n─────────────────────────n";

            //email发送
            mail($femail, $title, $message,"From: $yemail");
//echo nl2br($message);
            $ok='no';
            echo "

".nl2br($message)."

回到发送页面";

    }
    exit();
}
?>



将网页推荐给好友


Related labels:
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