Bluehost不发送我的电子邮件,但在本地主机上完全正常
创始人
2024-12-23 01:30:25
0

这个问题可能是Bluehost的SMTP服务器没有正确配置所导致的。你可以将脚本中的SMTP服务器更改为以下内容,以确保重试发送您的电子邮件:

// Replace this with your own email
$to = "youremail@email.com";

// Replace this with the subject of the email
$subject = "Subject of the email";

// Replace this with the body of the email
$body = "Body of the email";

// Replace this with your own email address
$from = "youremail@email.com";

require_once("phpmailer/class.phpmailer.php");

$mail = new PHPMailer();

$mail->IsSMTP();
$mail->SMTPDebug = 1; // Debugging purposes only
$mail->SMTPAuth = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com"; // Replace this with your SMTP server
$mail->Port = 465; // Typically 587, but may vary
$mail->Username = "yourusername";
$mail->Password = "yourpassword";
$mail->SetFrom($from);
$mail->Subject = $subject;
$mail->Body = $body;
$mail->AddAddress($to);

if(!$mail->Send()) {
    echo "Mailer Error: " . $mail->ErrorInfo;
} else {
    echo "Message has been sent";
}

确保替换以下内容以符合您的WordPress站点上的设置:

将 $to 和 $from 更改为您要发送电子邮件的电子邮件地址。

将 $subject 更改为电子邮件的主题。

将 $body 更改为电子邮件的内容。

将 Host 更改为您的SMTP服务器。

相关内容

热门资讯

此事备受玩家关注!wepoke... 此事备受玩家关注!wepoker软件靠谱么,德普之星透视辅助软件,一直真的有挂(有挂教学)1、德普之...
黑科技代打!hhpoker有作... 黑科技代打!hhpoker有作弊的吗,德普之星透视辅助软件下载,真是真的有挂(有挂教程)1、游戏颠覆...
有玩家发现!德州hhpoker... 有玩家发现!德州hhpoker是真的吗,德扑之星透视辅助插件,切实是真的有挂(有挂辅助)德扑之星透视...
据统计!hhpoker有没有作... 据统计!hhpoker有没有作弊辅助,德普之星辅助工具如何打开,真是真的是有挂(存在有挂)1、用户打...
据文件显示!wepoker透视... 据文件显示!wepoker透视苹果系统,德扑之星透视辅助软件激活码,都是存在有挂(真的有挂)1、金币...
复盘辅助挂!hhpoker必备... 复盘辅助挂!hhpoker必备开挂,德扑之星辅助器怎么用,竟然真的是有挂(的确有挂)德扑之星辅助器怎...
更值得关注的是!wepoker... 更值得关注的是!wepoker有没有透视方法,智星德州插件怎么下载,原来存在有挂(有挂攻略)1、进入...
2026版辅助挂!hhpoke... 2026版辅助挂!hhpoker可以控制牌吗,德普辅助软件,原来存在有挂(有挂方式)德普辅助软件辅助...
代打辅助挂!wepoker透视... 代打辅助挂!wepoker透视最简单三个步骤,如何下载德普之星辅助软件,一直真的有挂(有挂存在)1、...
黑科技攻略!聚星ai辅助工具下... 黑科技攻略!聚星ai辅助工具下载,德普辅助器怎么用,本来确实有挂(确实有挂)1、德普辅助器怎么用免费...