OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

PHPMailer error at sending email with infinite loop

  • Thread starter Thread starter splmn
  • Start date Start date
S

splmn

Guest
I am currently making a website. And I would like to give users the opportunity to send emails here. But I have a problem that I can't solve. I wrote the following program for email.

Code:
use PHPMailer\PHPMailer\PHPMailer;

require ’r/src/Exception.php';
require r/src/PHPMailer.php';
require r/src/SMTP.php';

$mail = new PHPMailer();

$mail->isSMTP();
$mail->Host = ’*;
$mail->SMTPAuth = true;
$mail->Username = *;
$mail->Password = *;
$mail->SMTPSecure = 'tls';
$mail->SMTPDebug = 4;
$mail->Port = 465;
$mail->setFrom(*, 'First Last');

$mail->addAddress(*, 'First Last');

$mail->Subject = 'PHPMailer mail() test';
$mail->isHTML(TRUE);
$mail->Body = 'html>';


if(!$mail->send()){
    echo 'Message could not be sent.';
    echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
    echo 'Message has been sent';
}

But the $mail->send() function never executes. It does not return an error, but the program stops here.

Does anyone have any idea what the problem could be?

I tried to run the program with the debugger, but it keeps getting stuck at the mail.send line.

I didn't get an exception. Error reporting is turned on.

Mail sending takes forever.

Fatal error: Maximum execution time of 120 seconds exceeded PHPMailer-master\src\SMTP.php on line 1271

$n = stream_select($selR, $selW, $selW, $this->Timelimit); in get_lines function

I got the following messages:

2024-06-25 14:51:52 Connection: opening to mail. *.com:465, timeout=300, options=array() 2024-06-25 14:51:52 Connection: opened
<p>I am currently making a website.
And I would like to give users the opportunity to send emails here. But I have a problem that I can't solve. I wrote the following program for email.</p>
<pre><code>
use PHPMailer\PHPMailer\PHPMailer;

require ’r/src/Exception.php';
require r/src/PHPMailer.php';
require r/src/SMTP.php';

$mail = new PHPMailer();

$mail->isSMTP();
$mail->Host = ’*;
$mail->SMTPAuth = true;
$mail->Username = *;
$mail->Password = *;
$mail->SMTPSecure = 'tls';
$mail->SMTPDebug = 4;
$mail->Port = 465;
$mail->setFrom(*, 'First Last');

$mail->addAddress(*, 'First Last');

$mail->Subject = 'PHPMailer mail() test';
$mail->isHTML(TRUE);
$mail->Body = 'html>';


if(!$mail->send()){
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent';
}
</code></pre>
<p>But the $mail->send() function never executes. It does not return an error, but the program stops here.</p>
<p>Does anyone have any idea what the problem could be?</p>
<p>I tried to run the program with the debugger, but it keeps getting stuck at the mail.send line.</p>
<p>I didn't get an exception. Error reporting is turned on.</p>
<p>Mail sending takes forever.</p>
<p>Fatal error: Maximum execution time of 120 seconds exceeded PHPMailer-master\src\SMTP.php on line 1271</p>
<p>$n = stream_select($selR, $selW, $selW, $this->Timelimit); in get_lines function</p>
<p>I got the following messages:</p>
<p>2024-06-25 14:51:52 Connection: opening to mail. *.com:465, timeout=300, options=array()
2024-06-25 14:51:52 Connection: opened</p>
Continue reading...
 

Latest posts

Top