易截截图软件、单文件、免安装、纯绿色、仅160KB

php 发送 Email


< ?php   
require("mail/class.phpmailer.php");//调用   
$mail = new PHPMailer();//实例化phpmailer   
$address = "mailxi@126.com";//接收邮件的邮箱   
$mail->IsSMTP(); // 设置发送邮件的协议:SMTP   
$mail->Host = "smtp.163.com"; // 发送邮件的服务器   
$mail->SMTPAuth = true; // 打开SMTP   
$mail->Username = "我的账户"; // SMTP账户   
$mail->Password = "我的密码"; // SMTP密码   
$mail->from = "mailxi@163.com";   
$mail->fromName = "peng";   
$mail->AddAddress("$address", "");   
//$mail->AddAddress(""); // name is optional   
//$mail->AddReplyTo("", "");   
//$mail->WordWrap = 50; // set word wrap to 50 characters   
//$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments   
//$mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // optional name   
//$mail->IsHTML(true); // set email format to HTML   
$mail->CharSet = "UTF-8";//设置字符集编码   
$mail->Subject = "Sinopf的测试邮件";   
$mail->Body = "Hello,Sinopf的测试邮件";//邮件内容(可以是HTML邮件)   
$mail->AltBody = "This is the body in plain text for non-HTML mail clients";   
if(!$mail->Send())   
{   
echo "Message could not be sent. < p>";   
echo "Mailer Error: " . $mail->ErrorInfo;   
exit;   
}   
echo&nb


相关文档:

php variable circular reference

 
Php Variable Circular References

Circular-references has been a long outstanding issue with PHP. They are
caused by the fact that PHP uses a reference counted memory allocation
mechanism for its internal variables. This causes problems for longer
running scripts (such as an Applicatio ......

PHP的日期时间函数date()

整理活:PHP的日期时间函数date()
1,年-月-日
echo date('Y-m-j');
2007-02-6
echo date('y-n-j');
07-2-6
大写Y表示年四位数字,而小写y表示年的两位数字;
小写m表示月份的数字(带前导),而小写n则表示不带前导的月份数字。
echo date('Y-M-j');
2007-Feb-6
echo date('Y-m-d');
2007-02-06
大写M表示月份的 ......

php不包含某字符串的正则表达式


 摘要: 用正则实现包含某个字符串很容易,但如果实现不包含某个字符串呢?作者给出了一个解决方案。
判断一个字符串中是否含有另一字符串,php有很多方法,如下:
1. 常见函数
strstr($str, "abc");  
strstr($str, "abc");
2. 正则匹配
preg_match("/(abc)/is", $str);  
p ......

windows2003的IIS+PHP部署体验

php官方网站怎么就没有个详细的在windows上部署的文档呢
我在windows2003上部署php,老是出现404错误
查了google,按照上面说的增加了web扩展也不行
开了目录浏览,根目录下面居然没有index.php和其他的php文件
我人品看来不行了 ......

php 连接数据库 , 插入记录

         $username = "root";
         $password = "123";
         // 建立连接
         mysql_connect('localhost', $username, $p ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号