ileilive
沐颺
2018-11-03 03:09
采纳率: 100%
浏览 1.7k
已采纳

Could not instantiate mail function无法实例化邮件功能

include('class.phpmailer.php');
include('class.smtp.php');

    $mail = new PhpMailer(true);
    $mail->IsSMTP();
    $mail->CharSet ="UTF-8";//编码
    $mail->Debugoutput = 'html';// 支持HTML格式
    $mail->Host = "email-smtp.us-west-2.amazonaws.com";//HOST 地址
    $mail->Port = 465;//端口
    $mail->SMTPAuth = true;
    $mail->Username = "ILEIONLY7";//用户名
    $mail->Password = "AiDS+9n";//密码
    //$mail->SetFrom("ileionly@163.com","ilei");//发件人地址, 发件人名称
    $mail->From = 'ileionly@163.com';
    $mail->FromName = '小咸鱼';
    $mail->AddAddress("70217318@qq.com");//收信人地址
    //$mail->Subject = "=?utf-8?B?" . base64_encode() . "?=";
    if (!empty($type)) {
        $mail->AddAttachment("",""); // 添加附件,并指定名称
    }
    $mail->Subject = "ceshi";//邮件标题
    $mail->MsgHTML("zhengwen");
    if ($mail->Send()){
        return true;
    }else{
        return json_encode($mail,JSON_UNESCAPED_UNICODE);
    }


    在wampserver集成环境下,thinkPHP5.0.5版本下无法实现发送邮件工呢,是否有什么配置需要设置,环境基本上原始状态
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

相关推荐