setFrom 替代 goDaddy

问题描述

我知道 gmail、yahoo、hotmail 等不能与 goDaddy 和 PHPMailer 一起使用,但是我应该为 setFrom 使用什么电子邮件地址?我将不胜感激任何帮助解决这个问题! (我正在尝试将 html 联系表单中输入的姓名和电子邮件通过电子邮件发送给我)

<?php
  use PHPMailer\PHPMailer\PHPMailer;
  use PHPMailer\PHPMailer\SMTP;
  use PHPMailer\PHPMailer\Exception;

  require 'Exception.php';
  require 'PHPMailer.php';
  require 'SMTP.php';

  $mail = new PHPMailer();

  $mail->isSMTP();
  
  $mail->SMTPDebug = SMTP::DEBUG_SERVER;
  
  $mail->Host = 'localhost';
  $mail->SMTPAuth = false;
  $mail->SMTPAutoTLS = false; 
  $mail->Port = 25;

  //Set who the message is to be sent from
  $mail->setFrom('MY_UNUSABLE_EMAIL','MY_NAME');

  //Set an alternative reply-to address
  $mail->addReplyTo($_POST['email'],$_POST['name']);

  //Set who the message is to be sent to
  $mail->addAddress('MY_UNUSABLE_EMAIL','MY_NAME');
  
  // Content
  $mail->Body = <<<EOT
  You've recieved a new submission from: {$_POST['name']}.
  Their email is: {$_POST['email']}.
EOT;

  $mail->Send();
?>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)