Very useful a full email send program

Source: Internet
Author: User
Tags comments setcookie
Very useful a full email send program, very simple, the following code copy to a blank text page, such as index.php, run on the line. Concrete Example: http://zsvalley.uhome.net/email/index.php.
The following is the complete source code: (Please email:zsvalley@cmmail.com if you have any questions)

?

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 fill in 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 fill in your friend's email address correctly!" <a href= ' Javascript:history.go ( -1) ' > Return </A> ';

}else{

$message = $fname. ", hello: nn your friend". $yname. " Specifically, I would like to say to you: N-----------------------------------n ". $comments." n-----------------------------------nnn Services: Http://zsvalley.uhome.net/email/nn Valley network without boundaries http:// valley.coc.cc N─────────────────────────n ";

Email send
Mail ($femail, $title, $message, "from: $yemail");
echo nl2br ($message);
$ok = ' no ';
echo "
}
Exit ();
}
?>

<TITLE> recommend the website 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 ("Please fill in your name!") ");
}
else if (document.frmsend.yemail.value.length<1)
{
Alert ("Please fill in your email address!") ");
}
else if (document.frmsend.fname.value.length<1)
{
Alert ("Please fill in your friend's name!") ");
}
else if (document.frmsend.femail.value.length<1)
{
Alert ("Please fill in 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 City STR2
while (Str.search (STR1) >-1)
Str=str.replace (STR1,STR2);
return str;
}

function Getparenttitle () {//Get title of Parent page
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>
<body bgcolor=white link= #ec9f00 text= #aa0000 >
<center> <H3> Quick Email System! <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= bgcolor= #fdf4db > Theme: </td><td width= "40%" height= "" bgcolor=# Fdf4db>
<input class=st1 name= "title" Size= ">"
</td></tr> <tr> <td width= "40%" height= "ten" bgcolor= #fdf4db ></td><td width= "60%" Height= "Ten" bgcolor= "#fdf4db" ></td></tr>
<tr> <td width= "40%" height= "bgcolor=" #fdf4db > Your name: </td><td width= "60%" height= "" bgcolor=# Fdf4db><input class=st1 name= "Yname" size= "Value=<?echo" $yname?>></td></tr>
<tr> <td width= "40%" height= "ten" bgcolor= #fdf4db ></td><td width= "60%" height= "bgcolor=#" Fdf4db></td></tr>
<tr> <td width= "40%" height= bgcolor= #fdf4db > Email address: </td><td width= "60%" height= "" bgcolor=# Fdf4db><input class=st1 name= "Yemail" size= "Value=<?echo" $yemail?>></td></tr>
<tr> <td width= "40%" height= "ten" bgcolor= #fdf4db ></td><td width= "60%" height= "bgcolor=#" Fdf4db></td></tr>
<tr> <td width= "40%" height= bgcolor= #fdf4db > Friends name: </td><td width= "60%" height= "" bgcolor= #fdf4db ><input class=st1 name= "FName" size=
<tr> <td width= "40% height=" bgcolor= #fdf4db ></td><td width=60%height= "Ten" bgcolor= #fdf4db ></td></tr>
<tr> <td width= "40%" height= bgcolor= #fdf4db > Email address: </td><td width=60%height= "bgcolor=#" Fdf4db><input class=st1 name= "FEMAIL" size= "
<tr> <td width= "40% height=" bgcolor= #fdf4db ></td><td width=60%height= "Ten" bgcolor= #fdf4db ></td></tr>
<tr> <td width= "100%" height= "bgcolor=" #fdf4db colspan= "2" > What you want to say:</td></tr>
<tr> <td width= "100%" bgcolor= #fdf4db height= "Ten" colspan= "2" ><textarea class=st1 rows= "6" name= " Comments
cols= "></textarea></td></tr> <tr> <td width=" 100% "colspan=" 2 "bgcolor= #fdf4db > <div align= "center" ><input Type=button Class=st2
Value= "Sent" name= "send" Onclick=check () ></div></td></tr> </table></form></ center><br><!--#51Net-->
</body>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.