It is very practical to send a complete email Program , Very simple, put the following Code Copy to a blank text page, such as index. php, and run it. Specific instance: http://zsvalley.uhome.net/email/index.php.
The following are complete Source code (If you have any questions, please 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 "Please enter your email address correctly! <A href = 'javascript: history. Go (-1) '> return </a> ";
} Elseif (! Eregi ("^ [_. 0-9a-z-] + @ ([0-9a-z] [0-9a-z-] +.) + [A-Z] {2, 3} $", $ femail )){
Echo "Please enter your friend's email address correctly! <A href = 'javascript: history. Go (-1) '> return </a> ";
} Else {
$ Message = $ fname. "Hello, NN, your friend ". $ yname. "I want to send a special letter to you: N ------------------------------------- N ". $ comments. "N --------------------------------- NNN service: http://zsvalley.uhome.net/email/nn?#◆ Valley network borderless http://valley.coc.cc ◆ n ── ─ N ";
// Send by email
Mail ($ femail, $ title, $ message, "From: $ yemail ");
// Echo nl2br ($ message );
$ OK = 'no ';
Echo "<HTML> <body> ". nl2br ($ message ). "<br> <a href = index. php> return to the sending page </a> </body>
}
Exit ();
}
?>
<HTML>
<Head>
<Title> Recommend webpages to friends </title>
<Meta content = "text/html; charset = gb2312" http-equiv = Content-Type>
<Style type = text/CSS> body {
Font-size: 14px; line-Height: 18px
}
TD {
Font-size: 14px; line-Height: 18px
}
. ST1 {
Background-color: # ffcc66; border-bottom: # ffcc66 1px solid; border-left: # ffcc66 1px solid; border-Right: # ffcc66 1px solid; border-top: # ffcc66 1px solid; color: # aa0000; font-size: 9pt
}
. St2 {
Background-color: # ffcc66; border-bottom: # ec9f00 1px solid; border-left: # ffffff 1px solid; border-Right: # ec9f00 1px solid; border-top: # ffffff 1px solid; color: # aa0000; font-size: 9pt; Height: 20px; width: 60px
}
</Style>
<Script language = JavaScript runat = Server>
Function check ()
{
If (document. frmsend. yname. value. Length <1)
{
Alert ("enter your name! ");
}
Else if (document. frmsend. yemail. value. Length <1)
{
Alert ("Enter your email address! ");
}
Else if (document. frmsend. fname. value. Length <1)
{
Alert ("Enter your friend's name! ");
}
Else if (document. frmsend. femail. value. Length <1)
{
Alert ("Enter your friend's email address! ");
}
Else document. frmsend. Submit ();
}
// ===================================== Dragon code ====================== ======================
Function forhtmlspecialchars (STR) {// Replace special characters in HTML with code
STR = strreplace (STR ,"&","&");
STR = strreplace (STR ,""",""");
STR = strreplace (STR, "<", "<");
STR = strreplace (STR, ">", "> ");
STR = strreplace (STR, "% 20 ","");
Return STR;
}
Function strreplace (STR, str1, str2) {// replace all str1 in STR with str2.
While (Str. Search (str1)>-1)
STR = Str. Replace (str1, str2 );
Return STR;
}
Function getparenttitle () {// obtain the parent page title
STR = location. href;
STR = Str. substring (Str. indexof ("parenttitle"), str. indexof ("parenttitleend "));
STR = Str. substring (12, str. Length );
Return STR;
}
// ================================================ ======================
</SCRIPT>
<Meta content = "mshtml 5.00.2920.0" name = generator>
</Head>
<Body bgcolor = white link = # ec9f00 text = # aa0000>
<Center> <Input type = "hidden" name = "Referer" value = "<? Echo $ Referer;?> "> <Input type =" hidden "name =" OK "value =" yes "> <input type =" hidden "name =" title "value =" <? Echo $ parenttitle;?> "> <Table bgcolor = # e99b0a border = 0 cellpadding = 2 cellspacing = 1>
<Tr> <TD width = "40%" Height = "22" bgcolor = # fdf4db> topic: </TD> <TD width = "40%" Height = "22" bgcolor = # fdf4db>
<Input class = ST1 name = "title" size = "20">
</TD> </tr> <TD width = "40%" Height = "10" bgcolor = # fdf4db> </TD> <TD width = "60%" height = "10" bgcolor = "# fdf4db"> </TD> </tr>
<Tr> <TD width = "40%" Height = "22" bgcolor = # fdf4db> your name: </TD> <TD width = "60%" Height = "22" bgcolor = # fdf4db> <input class = ST1 name = "yname" size = "20" value = <? Echo $ yname?> </TD> </tr>
<Tr> <TD width = "40%" Height = "10" bgcolor = # fdf4db> </TD> <TD width = "60%" Height = "10" bgcolor = # fdf4db> </TD> </tr>
<Tr> <TD width = "40%" Height = "22" bgcolor = # fdf4db> email address: </TD> <TD width = "60%" Height = "22" bgcolor = # fdf4db> <input class = ST1 name = "yemail" size = "20" value = <? Echo $ yemail?> </TD> </tr>
<Tr> <TD width = "40%" Height = "10" bgcolor = # fdf4db> </TD> <TD width = "60%" Height = "10" bgcolor = # fdf4db> </TD> </tr>
<Tr> <TD width = "40%" Height = "22" bgcolor = # fdf4db> friend's name: </TD> <TD width = "60%" Height = "22" bgcolor = # fdf4db> <input class = ST1 name = "fname" size = "20" value => </TD> </tr>
<Tr> <TD width = "40%" Height = "10" bgcolor = # fdf4db> </TD> <TD width = 60% Height = "10" bgcolor = # fdf4db> </TD> </tr>
<Tr> <TD width = "40%" Height = "22" bgcolor = # fdf4db> email address: </TD> <TD width = 60% Height = "22" bgcolor = # fdf4db> <input class = ST1 name = "femail" size = "20" value => </TD> </tr>
<Tr> <TD width = "40%" Height = "10" bgcolor = # fdf4db> </TD> <TD width = 60% Height = "10" bgcolor = # fdf4db> </TD> </tr>
<Tr> <TD width = "100%" Height = "22" bgcolor = # fdf4db colspan = "2"> what you want to say: </TD> </tr>
<Tr> <TD width = "100%" bgcolor = # fdf4db Height = "10" colspan = "2"> <textarea class = ST1 rows = "6" name = "Comments"
Cols = "36"> </textarea> </TD> </tr> <TD width = "100%" colspan = "2" bgcolor = # fdf4db> <Div align = "center"> <input type = button class = st2
Value = "send" name = "send" onclick = check ()> </div> </TD> </tr> </table> </form> </center> <br> <! -- # 51net -->
</Body>
</Html>
[This article is copyrighted by the author and osuo. If you need to reprint it, please indicate the author and its source]