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 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操作数组时候,给一个数组添加一个数组单元时候可以有两种方式:
1.
$arr = array();
$arr[] = '';
2.
$arr = array();
array_push($arr,'');
刚做一个100000次的循环插入,结果还是第一种要快一些!(循环插入数字,100000次,第一种0.04左右,第二种0.08秒左右) ......
转载请注明出处: http://www.zvv.cn/blog/show-101-1.html
前些天发现通过Notepad++的DBGP插件结合PHP的xdebug扩展可以实现PHP文件调试,同时,介绍说包含了单步调试、监视变量还有跨 文件调试。按照网络上的资料配置好调试环境后实际试用了发现功能较为简陋,单文件调试还可,如果是跨文件调试项目就不那么舒服了, ......
// 定义一个新变量
$test = "hello";
// . 字符串连接符
echo $test.".world" // hello.world
echo "$test.world" // "" 中的变量将被解析成相应的值
&nbs ......
$username = "root";
$password = "123";
// 建立连接
mysql_connect('localhost', $username, $p ......