PHP 发送邮件
PHP 发送邮件
作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-28 修改:2007-06-17 浏览:14208 :: ::
PHP Sessions
PHP allows you to send e-mails directly from a script.
PHP允许你通过脚本直接发送e-mail。
The PHP mail() Function
PHP mail()函数
The PHP mail() function is used to send emails from inside a script.
PHP mail()函数可以从脚本内发送email。
Syntax
语法
mail(to,subject,message,headers,parameters)
Parameter
参数Description
描述
to
Required. Specifies the receiver / receivers of the email
必要参数。指定email的接收者
subject
Required. Specifies the subject of the email. Note: This parameter cannot contain any newline characters
必要参数。指出email的主题。注意:这个参数包含的字符不能换行(只能显示一行)
message
Required. Defines the message to be sent. Each line should be separated with a LF (n). Lines should not exceed 70 characters
必要参数。定义发送的信息。每行都必须用(n)分隔开。每行不能超过70个字符
headers
Optional. Specifies additional headers, like from, Cc, and Bcc. The additional headers should be separated with a CRLF (rn)
可选参数。指定附加标题,如:form、Cc及Bcc。附加标题通过(rn)进行分隔
parameters
Optional. Specifies an additional parameter to the sendmail program
可选参数。给sendmail程序指定一个附加参数
Note: For the mail functions to be available, PHP requires an installed and working email system. The program to be used is defined by the configuration settings in the php.ini file. Read more in our PHP Mail reference.
注意:PHP需要安装、运行email系统才可以使用mail函数。所使用的程序是通过php.ini文件中的配置属性来确定的。阅读更多的关于PHP Mail参数。
PHP Simple E-Mail
简易的E-mail
The simplest way to send an email with PHP is to send a text email.
使用PHP发送邮件的最简单的方法就是发送一个文本格式的email。
In the example below we first declare the variables ($to, $subject, $message, $from, $headers), then we use the variables in the mail() function to sen
相关文档:
【1】页面之间无法传递变量 get,post,session在最新的php版本中自动全局变量是关闭的,所以要从上一页面取得提交过来得变量要使用$_GET['foo'],$ _POST['foo'],$_SESSION['foo']来得到。当然也可以修改自动全局变量为开(php.ini改为 register_globals = On);考虑到兼容性,还是强迫自己熟悉新的写法比较好。
【 ......
/*
* 功能:PHP
图片水印 (水印支持图片或文字)
* 参数:
* $product_img 背景图片,即需要加水印的图片,暂只支持GIF,JPG,PNG格式;
* $waterPos 水印位置,有10种状态,0为随机位置;
* &n ......
今天看到了一笔记上面是这么说的:
2. 不转意SQL输入
我曾经在一篇文章中最简单的防止sql注入的方法(php+mysql中)讨论过这个问题并给出了一个简单的方法 。有人对我说,他们已经在php.ini中将magic_quotes设置为On,所以不必担心这个问题,但是不是所有的输入都是从$_GET, $_POST或 $_COOKIE中的得到的!
如何修复:
和 ......
#找到:
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gz ......