When using the standard Codeigniter
mail->send()
it only returns TRUE or FALSE. However, I have requirements to handle certain SMTP return codes differently. I could parse out of the debug text info, or somehow try to override the mail handler for Codeigniter. Is there any straight forward and elegant way to do this?
Thanks in advance.
I dont think there is a build in mechanism for this in CodeIgniter. What you could do is extend the CI email class and add a function to expose the protected
_debug_msgarray.If you look at the source of email class you will see that
print_debugger()function is converting_debug_msgarray into string. So if_debug_msghas what you are looking for then you wouldn’t have to parse any string.Refer the following link on how to extend CI libs
http://codeigniter.com/user_guide/general/creating_libraries.html