CodeIgniter Forums
Email smtp connection error not captured - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Email smtp connection error not captured (/showthread.php?tid=32967)



Email smtp connection error not captured - El Forum - 08-11-2010

[eluser]Unknown[/eluser]
while sending email using smtp server if the connection fails
an error is thrown rather than a gracious exit
Code:
A PHP Error was encountered
Severity: Warning
Message: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: No such host is known.
Filename: libraries/Email.php
Line Number: 1652
A PHP Error was encountered
Severity: Warning
Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (php_network_getaddresses: getaddrinfo failed: No such host is known. )
Filename: libraries/Email.php
Line Number: 1652
A PHP Error was encountered
Severity: Warning
Message: fwrite() expects parameter 1 to be resource, boolean given
Filename: libraries/Email.php
Line Number: 1795
A PHP Error was encountered
Severity: Warning
Message: fgets() expects parameter 1 to be resource, boolean given
Filename: libraries/Email.php
Line Number: 1818
A PHP Error was encountered
Severity: Warning
Message: fwrite() expects parameter 1 to be resource, boolean given
Filename: libraries/Email.php
Line Number: 1795
A PHP Error was encountered

this couldnot be captured by a try catch block either.

EDIT::

Well I am not sure if this is a bug or it is the way things work in PHP!
Moderators, i think i should move the post to a more appropriate category or delete it