Home >Backend Development >PHP Tutorial >A very practical and complete email sending program_PHP tutorial
A very practical and complete email sending program. It is very simple. Just copy the following code to a blank text page, such as index.php, and run it. Specific example: http://zsvalley.uhome.net/email/index.php.
The following is the 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 be correct Fill in your EMAIL address! Return"; -9a-z-]+@([0-9a-z][0-9a-z-]+.)+[a-z]{2,3}$",$femail)){
echo "Please fill in your friend's EMAIL address correctly! Return";
}else{
$message=$fname.",Hello:nnYour friend ".$yname." I wrote a special letter to say to you:n----------------- ------------------n".$comments."n------------------------ ----------nnn provides services: http://zsvalley.uhome.net/email/nn◆◆◆ valley network without boundaries http://valley.coc.cc ◆◆◆n─── ──────────────────────n";
//Send email
mail($femail, $title, $message," From: $yemail");
//echo nl2br($message);
$ok='no'; "
Back to sending page