PHPMailer stuck on “Connection: opened”












0















Bellow is my code used to send an email. PHPMailer output messages are:



2019-01-19 13:47:42        Connection: opening to xxxxxx:465, timeout=5, options=array()  
2019-01-19 13:47:42 Connection: opened


I tried with a wrong password and nothing changes. Does anyone has an ideea what it may happen?



$mail = new PHPMailer();
$mail->isSMTP(); // Set mailer to use SMTP
$mail->SMTPDebug = 3; // Enable verbose debug output
$mail->Host = 'xxxxxxx'; // Specify main and backup SMTP servers
$mail->Port = 465; // TCP port to connect to
$mail->SMTPAuth = true; // Enable SMTP authentication


$mail->Username = 'xxxxxxxx@xxx.xxx'; // SMTP username
$mail->Password = 'xxxxxxxx'; // SMTP password



$mail->setFrom('xxxxxxxxxxx', 'xxxxxxx');
$mail->addAddress('xxxxx', 'xxxxx'); // Add a recipient
$mail->addReplyTo('xxxxxxxxxx', 'xxxxxx');
$mail->isHTML(true); // Set email format to HTML
$mail->Timeout = 5;
$mail->Subject = $subject;
$mail->Body = $text;

$mail->send();









share|improve this question

























  • $mail->send() ?

    – Eric
    Jan 19 at 13:55











  • @Eric sorry. I forgot to add it in question, but not in script. I edited the question. Thanks for your tip.

    – besciualex
    Jan 19 at 14:03











  • This isn't reproducible to anyone. Code excerpt irrelevant. Investigate network issues.

    – mario
    Jan 19 at 14:03






  • 1





    Use $mail->SMTPDebug = 2; for SERVER debug

    – Eric
    Jan 19 at 14:05











  • @Martin I wrote timeout 5 just for testing purposes. Even this does not trigger an error.

    – besciualex
    Jan 19 at 14:18
















0















Bellow is my code used to send an email. PHPMailer output messages are:



2019-01-19 13:47:42        Connection: opening to xxxxxx:465, timeout=5, options=array()  
2019-01-19 13:47:42 Connection: opened


I tried with a wrong password and nothing changes. Does anyone has an ideea what it may happen?



$mail = new PHPMailer();
$mail->isSMTP(); // Set mailer to use SMTP
$mail->SMTPDebug = 3; // Enable verbose debug output
$mail->Host = 'xxxxxxx'; // Specify main and backup SMTP servers
$mail->Port = 465; // TCP port to connect to
$mail->SMTPAuth = true; // Enable SMTP authentication


$mail->Username = 'xxxxxxxx@xxx.xxx'; // SMTP username
$mail->Password = 'xxxxxxxx'; // SMTP password



$mail->setFrom('xxxxxxxxxxx', 'xxxxxxx');
$mail->addAddress('xxxxx', 'xxxxx'); // Add a recipient
$mail->addReplyTo('xxxxxxxxxx', 'xxxxxx');
$mail->isHTML(true); // Set email format to HTML
$mail->Timeout = 5;
$mail->Subject = $subject;
$mail->Body = $text;

$mail->send();









share|improve this question

























  • $mail->send() ?

    – Eric
    Jan 19 at 13:55











  • @Eric sorry. I forgot to add it in question, but not in script. I edited the question. Thanks for your tip.

    – besciualex
    Jan 19 at 14:03











  • This isn't reproducible to anyone. Code excerpt irrelevant. Investigate network issues.

    – mario
    Jan 19 at 14:03






  • 1





    Use $mail->SMTPDebug = 2; for SERVER debug

    – Eric
    Jan 19 at 14:05











  • @Martin I wrote timeout 5 just for testing purposes. Even this does not trigger an error.

    – besciualex
    Jan 19 at 14:18














0












0








0








Bellow is my code used to send an email. PHPMailer output messages are:



2019-01-19 13:47:42        Connection: opening to xxxxxx:465, timeout=5, options=array()  
2019-01-19 13:47:42 Connection: opened


I tried with a wrong password and nothing changes. Does anyone has an ideea what it may happen?



$mail = new PHPMailer();
$mail->isSMTP(); // Set mailer to use SMTP
$mail->SMTPDebug = 3; // Enable verbose debug output
$mail->Host = 'xxxxxxx'; // Specify main and backup SMTP servers
$mail->Port = 465; // TCP port to connect to
$mail->SMTPAuth = true; // Enable SMTP authentication


$mail->Username = 'xxxxxxxx@xxx.xxx'; // SMTP username
$mail->Password = 'xxxxxxxx'; // SMTP password



$mail->setFrom('xxxxxxxxxxx', 'xxxxxxx');
$mail->addAddress('xxxxx', 'xxxxx'); // Add a recipient
$mail->addReplyTo('xxxxxxxxxx', 'xxxxxx');
$mail->isHTML(true); // Set email format to HTML
$mail->Timeout = 5;
$mail->Subject = $subject;
$mail->Body = $text;

$mail->send();









share|improve this question
















Bellow is my code used to send an email. PHPMailer output messages are:



2019-01-19 13:47:42        Connection: opening to xxxxxx:465, timeout=5, options=array()  
2019-01-19 13:47:42 Connection: opened


I tried with a wrong password and nothing changes. Does anyone has an ideea what it may happen?



$mail = new PHPMailer();
$mail->isSMTP(); // Set mailer to use SMTP
$mail->SMTPDebug = 3; // Enable verbose debug output
$mail->Host = 'xxxxxxx'; // Specify main and backup SMTP servers
$mail->Port = 465; // TCP port to connect to
$mail->SMTPAuth = true; // Enable SMTP authentication


$mail->Username = 'xxxxxxxx@xxx.xxx'; // SMTP username
$mail->Password = 'xxxxxxxx'; // SMTP password



$mail->setFrom('xxxxxxxxxxx', 'xxxxxxx');
$mail->addAddress('xxxxx', 'xxxxx'); // Add a recipient
$mail->addReplyTo('xxxxxxxxxx', 'xxxxxx');
$mail->isHTML(true); // Set email format to HTML
$mail->Timeout = 5;
$mail->Subject = $subject;
$mail->Body = $text;

$mail->send();






php phpmailer






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 19 at 14:02







besciualex

















asked Jan 19 at 13:53









besciualexbesciualex

1,1871017




1,1871017













  • $mail->send() ?

    – Eric
    Jan 19 at 13:55











  • @Eric sorry. I forgot to add it in question, but not in script. I edited the question. Thanks for your tip.

    – besciualex
    Jan 19 at 14:03











  • This isn't reproducible to anyone. Code excerpt irrelevant. Investigate network issues.

    – mario
    Jan 19 at 14:03






  • 1





    Use $mail->SMTPDebug = 2; for SERVER debug

    – Eric
    Jan 19 at 14:05











  • @Martin I wrote timeout 5 just for testing purposes. Even this does not trigger an error.

    – besciualex
    Jan 19 at 14:18



















  • $mail->send() ?

    – Eric
    Jan 19 at 13:55











  • @Eric sorry. I forgot to add it in question, but not in script. I edited the question. Thanks for your tip.

    – besciualex
    Jan 19 at 14:03











  • This isn't reproducible to anyone. Code excerpt irrelevant. Investigate network issues.

    – mario
    Jan 19 at 14:03






  • 1





    Use $mail->SMTPDebug = 2; for SERVER debug

    – Eric
    Jan 19 at 14:05











  • @Martin I wrote timeout 5 just for testing purposes. Even this does not trigger an error.

    – besciualex
    Jan 19 at 14:18

















$mail->send() ?

– Eric
Jan 19 at 13:55





$mail->send() ?

– Eric
Jan 19 at 13:55













@Eric sorry. I forgot to add it in question, but not in script. I edited the question. Thanks for your tip.

– besciualex
Jan 19 at 14:03





@Eric sorry. I forgot to add it in question, but not in script. I edited the question. Thanks for your tip.

– besciualex
Jan 19 at 14:03













This isn't reproducible to anyone. Code excerpt irrelevant. Investigate network issues.

– mario
Jan 19 at 14:03





This isn't reproducible to anyone. Code excerpt irrelevant. Investigate network issues.

– mario
Jan 19 at 14:03




1




1





Use $mail->SMTPDebug = 2; for SERVER debug

– Eric
Jan 19 at 14:05





Use $mail->SMTPDebug = 2; for SERVER debug

– Eric
Jan 19 at 14:05













@Martin I wrote timeout 5 just for testing purposes. Even this does not trigger an error.

– besciualex
Jan 19 at 14:18





@Martin I wrote timeout 5 just for testing purposes. Even this does not trigger an error.

– besciualex
Jan 19 at 14:18












1 Answer
1






active

oldest

votes


















0














This is a code problem, not a network issue.



You’re connecting to port 465, which is typically used for implicit TLS (i.e. it expects you to talk TLS immediately), known as SMTPS, but you have not told PHPMailer to do that, so it will just hang, as you’re seeing. Fix it by setting that TLS mode:



$mail->SMTPSecure = 'ssl';





share|improve this answer
























  • Thanks for response. I'll test it in a few hours and come back with an reply.

    – besciualex
    Jan 20 at 10:51











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54267797%2fphpmailer-stuck-on-connection-opened%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














This is a code problem, not a network issue.



You’re connecting to port 465, which is typically used for implicit TLS (i.e. it expects you to talk TLS immediately), known as SMTPS, but you have not told PHPMailer to do that, so it will just hang, as you’re seeing. Fix it by setting that TLS mode:



$mail->SMTPSecure = 'ssl';





share|improve this answer
























  • Thanks for response. I'll test it in a few hours and come back with an reply.

    – besciualex
    Jan 20 at 10:51
















0














This is a code problem, not a network issue.



You’re connecting to port 465, which is typically used for implicit TLS (i.e. it expects you to talk TLS immediately), known as SMTPS, but you have not told PHPMailer to do that, so it will just hang, as you’re seeing. Fix it by setting that TLS mode:



$mail->SMTPSecure = 'ssl';





share|improve this answer
























  • Thanks for response. I'll test it in a few hours and come back with an reply.

    – besciualex
    Jan 20 at 10:51














0












0








0







This is a code problem, not a network issue.



You’re connecting to port 465, which is typically used for implicit TLS (i.e. it expects you to talk TLS immediately), known as SMTPS, but you have not told PHPMailer to do that, so it will just hang, as you’re seeing. Fix it by setting that TLS mode:



$mail->SMTPSecure = 'ssl';





share|improve this answer













This is a code problem, not a network issue.



You’re connecting to port 465, which is typically used for implicit TLS (i.e. it expects you to talk TLS immediately), known as SMTPS, but you have not told PHPMailer to do that, so it will just hang, as you’re seeing. Fix it by setting that TLS mode:



$mail->SMTPSecure = 'ssl';






share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 19 at 19:34









SynchroSynchro

18.2k85371




18.2k85371













  • Thanks for response. I'll test it in a few hours and come back with an reply.

    – besciualex
    Jan 20 at 10:51



















  • Thanks for response. I'll test it in a few hours and come back with an reply.

    – besciualex
    Jan 20 at 10:51

















Thanks for response. I'll test it in a few hours and come back with an reply.

– besciualex
Jan 20 at 10:51





Thanks for response. I'll test it in a few hours and come back with an reply.

– besciualex
Jan 20 at 10:51


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54267797%2fphpmailer-stuck-on-connection-opened%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Liquibase includeAll doesn't find base path

How to use setInterval in EJS file?

Petrus Granier-Deferre