我正在尝试将邮件发送到我的域邮件服务器:我使用了 try{} catch(){} 来检测是否存在任何错误,但令人惊讶的是,没有任何错误。
<?php
function Redirect_to($New_Location){
header("Location:" . $New_Location);
exit;
}
if(isset($_POST['Submitenq'])){
require('phpmailer/PHPMailerAutoload.php');
define ('GUSER','courses@cadcentreju.org');
define ('GPWD','mymailpass');
$recever1 = 'courses@cadcentreju.org';
$enq_name = $_POST["enq_name"];
$enq_email = $_POST["enq_email"];
$enq_phone = $_POST["enq_phone"];
$enq_message = $_POST["enq_message"];
date_default_timezone_set("Asia/Kolkata");
$CurrentTime = time();
$DateTime = strftime("%B-%d-%Y %H:%M:%S",$CurrentTime);
if(empty($enq_name) || empty($enq_email) || empty($enq_phone) || empty($enq_message)){
Redirect_to("index.php?error=1");
}else{
$mail = new PHPMailer();
try{
$mail->IsSMTP();
$mail->Mailer = "smtp";
// $mail->SMTPDebug = 2;
$mail->SMTPAuth = TRUE;
$mail->SMTPSecure = "ssl";
$mail->Port = 465;
$mail->Host = "mail.supremecluster.com";
// $mail->CharSet = "UTF-8";
$mail->Username = GUSER;
$mail->Password = GPWD;
$mail->isHTML(true);
$mail->setFrom($enq_email,$enq_name);
$mail->addAddress($recever1);
$mail->Subject = 'Enquery Mail from - '. $enq_name;
$mail->Body = '<table class="table" cellspacing="0">
<thead>
<tr>
<th colspan="2">Enquery Mail from - '. $enq_name .'</th>
</tr>
</thead>
它显示电子邮件已成功发送,但我没有收到任何邮件。
我联系了我的服务器帮助热线,他们说某些 IP 被阻止了。但现在我已经从 CPanel 允许了这些 IP。但邮件仍然没有发送
我真的需要这方面的帮助:)
感谢您抽出时间阅读。
潇潇雨雨
侃侃无极
POPMUISE