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 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试
  • ¥20 问题请教!vue项目关于Nginx配置nonce安全策略的问题
  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题