-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Error: Email SMTP may throw Uncaught ErrorException #3390
Comments
Is this an intended error that we should see or it is a real Uncaught ErrorException ? |
What wrong config did you make exactly? From my Googling, this behavior is expected from SMTP servers and is not a framework bug. One use case where this will appear is when you have the wrong SMTP port. As I understand it, the server is assuming you as a spammer and closes the connection early, thus giving you that exception. |
Yes exactly, sorry for not testing exactly which are the cases, but it seems when you put the wrong port, it gives you this Uncaught ErrorException. But the problem is i don`t see it in a codeigniter manor error. it just outputs the error in the printDebuger() function i think. Anyway it is not that a big of a problem the script continues to execute even if the error is written. I think, i never tested everything. But yeah when you use SMTP and put a wrong port for me it output this error. So i thought it was some bug from codeigniter. |
I'm sorry but was is |
with the Codeigniter Error Toolbar included, the error didnt appear anywhere until i put a die() after the email sending to check what was the problem. |
Have you checked your |
Ideally, if there were errors in sending emails, these would be logged in your error logs in the writable folder. These will not stop script execution as the sending happens inside a try block. |
yes it got logged.. anyway i think it got fixed with the new update for the email pull request |
Hello. I'm having same issue
How do i go about it please? |
@ogeet Try: --- a/system/Email/Email.php
+++ b/system/Email/Email.php
@@ -2144,7 +2144,13 @@ class Email
public function __destruct()
{
if (is_resource($this->SMTPConnect)) {
- $this->sendCommand('quit');
+ try {
+ $this->sendCommand('quit');
+ } catch (ErrorException $e) {
+ $protocol = $this->getProtocol();
+ $method = 'sendWith' . ucfirst($protocol);
+ log_message('error', 'Email: ' . $method . ' throwed ' . $e->getMessage());
+ }
}
}
|
Hello guys i found an Uncaught ErrorException: fwrite():
When the configuration of the email is wrong this error appears almost in every case
The text was updated successfully, but these errors were encountered: