fixed incorrect use of fwrite() in smtp_library