当前位置: 首页 > php > 正文

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(); } ?>]]>

PHP使用JMail发送邮件:等您坐沙发呢!

发表评论

gravatar

? razz sad evil ! smile oops grin eek shock ??? cool lol mad twisted roll wink idea arrow neutral cry mrgreen

快捷键:Ctrl+Enter