如果我使用Gmail smtp凭据正常工作,并在上线服务器后它无法正常工作。当我使用godaddy网络邮件时,它无法在localhost或实时服务器上运行。
这是我的PHP文件。
<?php
$data = json_decode(file_get_contents("php://input"));
$Cust_Email = $data->Cust_Email;
$result = array();
require 'vendor/PHPMailerAutoload.php';
$mail = new PHPMailer;
$mail->isSMTP();
$mail->Host = 'relay-hosting.secureserver.net';
$mail->SMTPAuth = true;
$mail->Username = 'orders@washbucket.info';
$mail->Password = '******';
$mail->SMTPSecure = 'ssl';
$mail->Port = 25;
$mail->setFrom('orders@washbucket.info', 'Admin');
$mail->addAddress($Cust_Email);
$mail->isHTML(true);
$mail->Subject = 'Welcome To User.';
$mail->Body = 'This is greating from Admin';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
if(!$mail->send()) {
$result = '_FAIL';
} else {
$result = '_SUCCESS';
}
echo json_encode($result);
?>