Wednesday, 05 March 2025
  1 Replies
  38 Visits
1
Votes
Undo
  Subscribe
SMTP error.
If email can not be sent you get a SMTP error and unable to view easy discuss pages anymore.

So if I put a fake email in and you have email notification set.
When a user replies you will get a breaking bug.
Saying SMTP error with the fake email on screen.
1 week ago
·
#67
Accepted Answer
0
Votes
Undo
SMTP error.
If email can not be sent you get a SMTP error and unable to view easy discuss pages anymore.

So if I put a fake email in and you have email notification set.
When a user replies you will get a breaking bug.
Saying SMTP error with the fake email on screen.


I had this error that breaks easydiscuss.

You only get this if you select joomla setting mailer to SMTP.

I have a work around for this fix.

/public_html/libraries/vendor/phpmailer/phpmailer/src/PHPMailer.php

on line 212

//Create error message for any bad addresses
if (count($bad_rcpt) > 0) {
$errstr = '';
foreach ($bad_rcpt as $bad) {
$errstr .= $bad['to'] . ': ' . $bad['error'];
}
throw new Exception($this->lang('recipients_failed') . $errstr, self::STOP_CONTINUE);
}

return true;
}


change to


//Fix Create error message for any bad addresses
if (count($bad_rcpt) > 0) {
$errstr = '';
foreach ($bad_rcpt as $bad) {
$errstr .= $bad['to'] . ': ' . $bad['error'] . '; ';
}

// Log the error instead of throwing an exception
error_log('SMTP Error: ' . $errstr);

// Optionally, return false to indicate a failure without stopping execution
return false;
}

return true;

}
chrisuk1410 selected the reply #67 as the answer for this post — 1 week ago
chrisuk1410 updated the category from General to EasyDiscuss — 1 week ago
1 week ago
·
#67
Accepted Answer
0
Votes
Undo
SMTP error.
If email can not be sent you get a SMTP error and unable to view easy discuss pages anymore.

So if I put a fake email in and you have email notification set.
When a user replies you will get a breaking bug.
Saying SMTP error with the fake email on screen.


I had this error that breaks easydiscuss.

You only get this if you select joomla setting mailer to SMTP.

I have a work around for this fix.

/public_html/libraries/vendor/phpmailer/phpmailer/src/PHPMailer.php

on line 212

//Create error message for any bad addresses
if (count($bad_rcpt) > 0) {
$errstr = '';
foreach ($bad_rcpt as $bad) {
$errstr .= $bad['to'] . ': ' . $bad['error'];
}
throw new Exception($this->lang('recipients_failed') . $errstr, self::STOP_CONTINUE);
}

return true;
}


change to


//Fix Create error message for any bad addresses
if (count($bad_rcpt) > 0) {
$errstr = '';
foreach ($bad_rcpt as $bad) {
$errstr .= $bad['to'] . ': ' . $bad['error'] . '; ';
}

// Log the error instead of throwing an exception
error_log('SMTP Error: ' . $errstr);

// Optionally, return false to indicate a failure without stopping execution
return false;
}

return true;

}
ryanlee set the type of the post as  Bug — 1 week ago
There are no replies made for this post yet.
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below.
Supported: gif,jpg,png,jpeg,zip,rar,pdf
· Insert · Remove
  Upload Files (Maximum 2MB)