PHP使用JMail发送邮件

silent = true; //屏蔽例外错误$jmail->charset = ‘gb2312’; //否则中文会乱码$jmail->From = ‘web535000@163.com’; //这里理论上是可以不与发件人地址相同的,但用163的试了几次都不行,改成一样的就可以了$jmail->FromName = ‘BoboTest’;$jmail->AddRecipient(‘abc1@163.com’); //可添加多个邮件接受者//$jmail->AddRecipient(‘abc2@163.com’);//$jmail->AddRecipient(‘abc3@163.com’);$jmail->Subject = ’email test.’;$jmail->Body = ‘this is test email.’;$jmail->MailServerUserName = ‘web535000@163.com’; //发信邮件账号$jmail->MailServerPassword = ‘123456’; //账户的密码try{$email = $jmail->Send(‘smtp.163.com’);if($email) echo ‘发送成功’;else echo ‘发送失败’;} catch (Exception $e){echo $e->getMessage();}?>]]>

原创文章,作者:键盘游走者,如若转载,请注明出处:http://www.708034.com/2012/12/php%e4%bd%bf%e7%94%a8jmail%e5%8f%91%e9%80%81%e9%82%ae%e4%bb%b6/

发表评论

邮箱地址不会被公开。 必填项已用*标注