后端开发|php教程
php
后端开发-php教程
使用了TP框架!以下是源码:
<?php
namespace ApiController;
h5收款源码,UBUNTU安装宽带选择,爬虫数据txt文本,php cell(),SEO的KDPlzw
use ThinkController;
销帮源码,ubuntu中nano用法,爬虫缸风扇6,web rtc php,seo模型技巧lzw
class EmailController extends Controller
{
public function test(){
占卜php网站源码,VScode函数快捷注释,ubuntu的论坛,linux按照tomcat,sqlite数据库怎么开发,我的世界爬虫升级全集下载,php文件隐藏,新沂seo排名优化,在线教育类网站模板,php找不到网页跳转到首页,手机用户中心模板lzw
$msg = pmail(493107977@,午夜DJ,封装测试,hello world); echo $msg;
}
?php>
<?php
return array(
//配置项=>配置值\TMPL_PARSE_STRING => array( \__ADMIN__ => /Public/Admin, \__COMMON__ => /Public/Common, \__VENDORS__ => /Public/Venders, \__HOME__ => /Public/Home, \__USER__ => /Public/User, \__UP_GOODS__=>/Public/Uploads/Goods, \__UP_USER__=>/Public/Uploads/User),PMAIL => array( Host => \, Username => xxxxxx, Password => xxxxxx, From => xxxxx@, FromName => xxxx,),
);
<?php
function pmail($tomail = ”,$toname = ”,$title = ”,$content = ”){
require_once VENDOR_PATH.PHPMailer/class.phpmailer.php;// 实例化$pm = new \PHPMailer();foreach (C(PMAIL) as $k => $v){ $pm->$k = $v;}
// 服务器相关信息
// $pm->Host = ‘’; // SMTP服务器
$pm->IsSMTP(); // 设置使用SMTP服务器发送邮件$pm->SMTPAuth = true; // 需要SMTP身份认证
// $pm->Username = ‘woainigui8888’; // 登录SMTP服务器的用户名
// $pm->Password = ‘7618387asd’; // 登录SMTP服务器的密码
//
//// 发件人信息
// $pm->From = ‘woainigui8888@’;
// $pm->FromName = ‘电音之王’;
// 收件人信息
$pm->AddAddress($tomail,$toname); // 添加一个收件人
// 邮件内容
$pm->CharSet = utf-8; // 内容编码$pm->Subject = $title; // 邮件标题$pm->MsgHTML($content); // 邮件内容
// $this->AddAttachment($path); // 附件
// 发送邮件
if($pm->Send()){ return true;}else { return $pm->ErrorInfo;}
}
使用PHP发送邮件出现这个错误:The following From address failed:xxxx@
回复内容:
使用了TP框架!以下是源码:
<?php
namespace ApiController;
use ThinkController;
class EmailController extends Controller
{
public function test(){
$msg = pmail(493107977@,午夜DJ,封装测试,hello world); echo $msg;
}
?php>
<?php
return array(
//配置项=>配置值\TMPL_PARSE_STRING => array( \__ADMIN__ => /Public/Admin, \__COMMON__ => /Public/Common, \__VENDORS__ => /Public/Venders, \__HOME__ => /Public/Home, \__USER__ => /Public/User, \__UP_GOODS__=>/Public/Uploads/Goods, \__UP_USER__=>/Public/Uploads/User),PMAIL => array( Host => \, Username => xxxxxx, Password => xxxxxx, From => xxxxx@, FromName => xxxx,),
);
<?php
function pmail($tomail = ”,$toname = ”,$title = ”,$content = ”){
require_once VENDOR_PATH.PHPMailer/class.phpmailer.php;// 实例化$pm = new \PHPMailer();foreach (C(PMAIL) as $k => $v){ $pm->$k = $v;}
// 服务器相关信息
// $pm->Host = ‘’; // SMTP服务器
$pm->IsSMTP(); // 设置使用SMTP服务器发送邮件$pm->SMTPAuth = true; // 需要SMTP身份认证
// $pm->Username = ‘woainigui8888’; // 登录SMTP服务器的用户名
// $pm->Password = ‘7618387asd’; // 登录SMTP服务器的密码
//
//// 发件人信息
// $pm->From = ‘woainigui8888@’;
// $pm->FromName = ‘电音之王’;
// 收件人信息
$pm->AddAddress($tomail,$toname); // 添加一个收件人
// 邮件内容
$pm->CharSet = utf-8; // 内容编码$pm->Subject = $title; // 邮件标题$pm->MsgHTML($content); // 邮件内容
// $this->AddAttachment($path); // 附件
// 发送邮件
if($pm->Send()){ return true;}else { return $pm->ErrorInfo;}
}
使用PHP发送邮件出现这个错误:The following From address failed:xxxx@