add error code to message when it fails to be sent or delivered