-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SMTP connect error #2974
Comments
Next time please read the error message and follow the link to the troubleshooting guide, which addresses this exact problem. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to send mail using code it works on locally but when i deploy it on live (Godaddy) hosting server
it gives me error
Here is the code
$mail = new PHPMailer();
$mail->isSMTP();
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
$mail->Host = 'send.one.com';
$mail->SMTPAuth = true;
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
$mail->Username = '[email protected]';
$mail->Password = '123456789';
$mail->setFrom('[email protected]');
$mail->addAddress('[email protected]');
$mail->isHTML(true);
$mail->Subject = 'Subject';
$mail->Body = 'This is the HTML message body';
if ($mail->send()) {
echo 'Message has been sent.';
} else {
echo 'Message could not be sent. Mailer Error: ' . $mail->ErrorInfo;
}
Here is the Error
2023-11-09 12:55:44 SMTP ERROR: Failed to connect to server: Connection refused (111)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Message could not be sent. Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/TroubleshootingSMTP server error: Failed to connect to server SMTP code: 111 Additional SMTP info: Connection refused
The text was updated successfully, but these errors were encountered: