ds000001 2015-06-04 15:49
浏览 109

phpmailer错误:无法实例化邮件功能

I am using localhost WAMP server (Windows) for webhosting. I am getting the following error.

phpmailer ERROR :Could not instantiate mail function.

I have tried many solutions but nothing worked for me.

PHP mailing script

    $mailer = new PHPMailer();
    $mailer->IsMAIL();
    $mailer->CharSet = 'utf-8';
    $mailer->AddAddress($formvars['email'],$formvars['name']);
    $mailer->Subject = "Your registration with ".$this->sitename;
    $mailer->From = $this->GetFromAddress();        
    $confirmcode = $formvars['confirmcode'];
    $confirm_url = $this->GetAbsoluteURLFolder().'/confirmreg.php?code='.$confirmcode;
    $mailer->Body ="Hello ".$formvars['name']."

".
    "Thanks for your registration with ".$this->sitename."
".
    "Please click the link below to confirm your registration.
".
    "$confirm_url
".
    "
".
    "Regards,
".
    "Webmaster
".
    $this->sitename;

    if(!$mailer->Send())
    {
        $this->HandleError("Failed sending registration confirmation email.".$mailer->ErrorInfo);
        //echo "Mailer Error: " . $mailer->ErrorInfo;
        return false;
    }
    return true;

How do I diagnose this error?

  • 写回答

2条回答 默认 最新

  • dqm4675 2015-06-04 16:11
    关注

    Configuring a working mail client from localhost is always a mission and often "unecessary" considering it's just a sandbox. Although some developers want to solve the puzzle (I am one of those), some look for an easier alternative.

    I would suggest that you install HMailServer

    I have seen lots of people having great luck at a very fast speed using hmail.

    Check this post for the step by step: How to send email from localhost WAMP Server to send email Gmail Hotmail or so forth?

    评论

报告相同问题?

悬赏问题

  • ¥15 虚拟机打包apk出现错误
  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 逻辑谓词和消解原理的运用
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么