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服务器。

相关内容

热门资讯

透视阶段!werplan免费挂... 透视阶段!werplan免费挂下载(透视)poker world辅助器(辅助)一直有神器(哔哩哔哩)...
透视模块!pokemmo手机版... 透视模块!pokemmo手机版透视脚本(透视)pokemmo辅助器脚本下载(辅助)本来一直总是有攻略...
透视法门!拱趴大菠萝十三水作必... 透视法门!拱趴大菠萝十三水作必弊(透视)xpoker辅助工具(辅助)一直存在有神器(哔哩哔哩)1、拱...
透视秘籍!哈糖大菠萝软件下载(... 透视秘籍!哈糖大菠萝软件下载(透视)xpoker怎么作必弊(辅助)总是有神器(哔哩哔哩)1、每一步都...
透视攻略!epoker透视(透... 透视攻略!epoker透视(透视)德州私人局脚本(辅助)切实一直都是有方法(哔哩哔哩)1、德州私人局...
透视方针!哈糖大菠萝破解器(透... 透视方针!哈糖大菠萝破解器(透视)pokemmo手机脚本(辅助)一贯真的是有方法(哔哩哔哩)1、游戏...
透视教程书!哈糖大菠萝怎么开挂... 透视教程书!哈糖大菠萝怎么开挂(透视)德州之星扫描器(辅助)确实是真的有神器(哔哩哔哩)1、游戏颠覆...
透视策略!来玩app破解(透视... 透视策略!来玩app破解(透视)pokermaster修改器(辅助)其实真的有app(哔哩哔哩)一、...
透视妙计!pokernow辅助... 您好,pokernow辅助控制这款游戏可以开挂的,确实是有挂的,需要了解加去威信【136704302...
透视方案!hh poker插件... 透视方案!hh poker插件下载(HHpoker开挂)一贯真的有辅助app(哔哩哔哩)1、让任何用...