php 发送表格,通过html表格发电子邮件

通过html表格发电子邮件

更新时间:2006年10月09日 00:00:00   作者:

如下:

/******************************************************************************

Description: This is a simple script to send emails via a html-form

to different users

Date        : 1999-02-25

Author        : amalesh kempf

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!

Subject
Body

wrap="PHYSICAL"> echo $strBody ?>

Category

Party

type="submit" value="Sende email">

}

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
";

// 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
";

}

}

?>

相关文章

1a1b05c64693fbf380aa1344a7812747.png

PHP新手上路(四)...2006-10-10

4f55910a645b073bc4fc65dc10dc14bd.png

PHP的缓存数据对更快更好的运行函数是非常有利的。如果一个文件在脚本中测试了多次,你也许会禁止对正确的结果进行缓存。为了实现这点,你可以使用clearstatcache()函数。2010-03-03

0ea3c7666119d5615e582f823fb3fad6.png

php学习笔记 数组遍历实现代码,需要的朋友可以参考下。2011-06-06

4f96a78db829b1556ff16de21e013c7a.png

理解学习PHP编码规范之注释和文件结构,编写规则的代码与目录结构让大家能快速的熟悉。提高协同工作效率。2010-07-07

8cc1031babc6aff2319f1c6af8544aa0.png

基本的 PHP 语法, 学习php的朋友基础入门教程。2009-10-10

0c932a99bb7b6f23c937db507070cc7b.png

如何将一个表单同时提交到两个地方处理...2006-10-10

cca732bf65a93ed2ec0ac80c638460fe.png

php中的session完全教程...2007-03-03

2d9f31f2af7b675a3d153d2b7f1035a7.png

nginx+php-fpm配置文件的组织结构介绍,需要的朋友可以参考下2012-11-11

b452cee8ec5cd9e58ab98eba17281e59.png

我的论坛源代码(八)...2006-10-10

f4838ec7e2d4da28e0b57d4e852dadd4.png

对于数字索引数组来说,通过 array_push()函数向数组中尾部添加元素,array_unshift头部添加元素,需要的朋友可以参考下2017-04-04

最新评论

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值