Skip to content
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

Closed
ali123-aliu opened this issue Nov 9, 2023 · 1 comment
Closed

SMTP connect error #2974

ali123-aliu opened this issue Nov 9, 2023 · 1 comment

Comments

@ali123-aliu
Copy link

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

@Synchro
Copy link
Member

Synchro commented Nov 9, 2023

Next time please read the error message and follow the link to the troubleshooting guide, which addresses this exact problem.

@Synchro Synchro closed this as completed Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants