ͨ¹ýhtml±í¸ñ·¢µç×ÓÓʼþ

5年以前  |  阅读数:367 次  |  编程语言:PHP 

ÈçÏ£º
<?

/**
Description: This is a simple script to send emails via a html-form
to different users
Date : 1999-02-25
Author : amalesh kempf amalesh@goatrance.de

Create this table
The field "what" is for different categories

CREATE TABLE email_notify (
ID int(11) DEFAULT '0' NOT NULL,
What varchar(60) DEFAULT '0' NOT NULL,
Name varchar(60) DEFAULT '0' NOT NULL,
Email varchar(60) DEFAULT '0' NOT NULL,
timestamp varchar(16),
KEY (What),
PRIMARY KEY (ID));

To fill this table you might create an insert form

***/

// Set this values:
$strHost ="localhost";
$strUser ="root";
$strPassw ="";
$strSender="you@domain.com";

if (!$btnSendEmail)
{
?>

The email will be added automatically with "Hello Name" in the first line of
the emailbody!


<form action="send_email.php3" enctype="application/x-www-form-    

urlencoded" method="post">

Subject
Body
Category

<?php
}

if (isset($btnSendEmail))
{ echo "Send Email
";

// Create connection    
$intConID = mysql_pconnect($strHost,$strUser,$strPassw);    

// Header    
$strHeader = "Return-Path: $strSender\nErrors-To: $strSender\nFrom:     

$strSender";

// SQL    
$strSQL = "select name,email from email_notify where lcase(what) =     

'$strWhat'";
$intRes = mysql_query($strSQL,$intConID);

echo "Send Email $strBody<br>";    

// fetch array        
while($saRow = mysql_fetch_array($intRes))    
{    $strEmail = $saRow["email"];    
    $strName = $saRow["name"];    
    $strBodyComplete = "Hello " . $strName[$i] . "!\n\n" . $strBody;    

    // Email    
    mail($strEmail,$strSubject,$strBodyComplete,$strHeader);    

    // Output    
    echo "Send to $strName<br>";    
}    

}
?>

 相关文章:
PHP分页显示制作详细讲解
SSH 登录失败:Host key verification failed
获取IMSI
将二进制数据转为16进制以便显示
获取IMEI
文件下载
贪吃蛇
双位运算符
PHP自定义函数获取搜索引擎来源关键字的方法
Java生成UUID
发送邮件
年的日历图
提取后缀名
在Zeus Web Server中安装PHP语言支持
让你成为最历害的git提交人
Yii2汉字转拼音类的实例代码
再谈PHP中单双引号的区别详解
指定应用ID以获取对应的应用名称
Python 2与Python 3版本和编码的对比
php封装的page分页类完整实例