doujia7094 2016-03-17 14:39
浏览 52
已采纳

PHPmailer致命错误

Hi guys i'm trying to use a php mailer however I keep getting issues for example in the sampler my emails simply won't send. So I changed to this new method and when testing i'm getting this error: Fatal error: Class 'SMTP' not found in /home3/hutch/public_html/Murphy/class.phpmailer.php on line 1325 anyone know why this is. I tried chanign the require to ("PHPMailerAutoload.php"); Which still didn't work still got the same error. I got both class.phpmailer.php and PHPMailerAutoload.php from the Github hosted documentation so I'm sure they are up to date. Any ideas?

<?php
require("class.phpmailer.php");

$mail = new PHPMailer();

$mail->IsSMTP();  // telling the class to use SMTP
$mail->Host     = "smtp.sulmaxmarketing.com"; // SMTP server

$mail->From     = "info@sulmaxmarketing.com";
$mail->AddAddress("sulmaxcp@gmail.com");

$mail->Subject  = "First PHPMailer Message";
$mail->Body     = "Hi! 

 This is my first e-mail sent through PHPMailer.";
$mail->WordWrap = 50;

if(!$mail->Send()) {
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
} 

else {
echo 'Message has been sent.';
}

?>
  • 写回答

1条回答 默认 最新

  • doufei7516 2016-03-17 14:43
    关注

    You are sending email using SMTP, so you need to include the SMTP class file:

    require("class.smtp.php");
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器