I am using phpmailer 5.2.2 and godaddy Linux host with cPanel.
After many tries on difference solution. It seems that all of methods is not suitable for me. To make it easier, I focus on methods provided by godaddy's staff.
- Localhost method(as following code) >>> How can I get this authorization to send the email?
Although the result is "Email sent.", the recipient email do not receive any mail or junk mail. For SMTP debug, godaddy's server gives me a message: 220-We do not authorize the use of this system to transport unsolicited,220 and/or bulk e-mail.
<?php
require_once 'bat/phpmailer/PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail->isSMTP();
$mail->Host = "localhost";
$mail->Port = 25;
$mail->SMTPSecure = false;
$mail->SMTPAuth = false;
$mail->Username = "";
$mail->Password = "";
$mail->SMTPDebug = 3;
$mail->Debugoutput= 'error_log';
$mail->IsHTML(true);
$mail->AddAddress("[email protected]");
$mail->CharSet = "utf-8";
$mail->setFrom('[email protected]', 'test name');
$mail->Subject = 'test title';
$mail->Body = 'testing content';
if (!$mail->Send()) {
echo "Error: " . $mail->ErrorInfo;
} else {
echo "<b>Email sent.</b>";
}
?>
- set host as 'relay-hosting.secureserver.net' >>> why it can't connect to server?
Another godaddy's staff suggest this host but it is worse. Using 'relay-hosting.secureserver.net', the debug message even shows: SMTP ERROR: Failed to connect to server: Connection refused (111). For this problem, I tried to live chat with their staff. Until now, their advises didn't helps.
Any one is successful in using their suggestion code? Please gives me some clues!
Many thanks...
$mail->SMTPDebug = 3;
it is written twice, also made$mail->SMTPAuth = false;
to true. you need to add the host for godaddy at$mail->Host = "localhost";
– Prashant Barve