function%20PHPMailerAutoload%28%24classname%29%0D%0A%7B%0D%0A%20%20%20%20%2F%2FCan%27t%20use%20__DIR__%20as%20it%27s%20only%20in%20PHP%205.3%2B%0D%0A%20%20%20%20%24filename%20%3D%20dirname%28__FILE__%29.DIRECTORY_SEPARATOR.%27class.%27.strtolower%28%24classname%29.%27.php%27%3B%0D%0A%20%20%20%20if%20%28is_readable%28%24filename%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20require%20%24filename%3B%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%0D%0Aif%20%28version_compare%28PHP_VERSION%2C%20%275.1.2%27%2C%20%27%3E%3D%27%29%29%20%7B%0D%0A%0D%0A%20%20%20%20if%20%28version_compare%28PHP_VERSION%2C%20%275.3.0%27%2C%20%27%3E%3D%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20spl_autoload_register%28%27PHPMailerAutoload%27%2C%20true%2C%20true%29%3B%0D%0A%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20spl_autoload_register%28%27PHPMailerAutoload%27%29%3B%0D%0A%20%20%20%20%7D%0D%0A%7D%20else%20%7B%0D%0A%0D%0A%20%20%20%20function%20__autoload%28%24classname%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20PHPMailerAutoload%28%24classname%29%3B%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%3F%3E%0D%0A%3C%3Fphp%0D%0A%0D%0Aclass%20SMTP%0D%0A%7B%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20PHPMailer%20SMTP%20version%20number.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20const%20VERSION%20%3D%20%275.2.28%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20SMTP%20line%20break%20constant.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20const%20CRLF%20%3D%20%22%5Cr%5Cn%22%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20SMTP%20port%20to%20use%20if%20one%20is%20not%20specified.%0D%0A%20%20%20%20%20%2A%20%40var%20integer%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20const%20DEFAULT_SMTP_PORT%20%3D%2025%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20maximum%20line%20length%20allowed%20by%20RFC%202822%20section%202.1.1%0D%0A%20%20%20%20%20%2A%20%40var%20integer%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20const%20MAX_LINE_LENGTH%20%3D%20998%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Debug%20level%20for%20no%20output%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20const%20DEBUG_OFF%20%3D%200%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Debug%20level%20to%20show%20client%20-%3E%20server%20messages%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20const%20DEBUG_CLIENT%20%3D%201%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Debug%20level%20to%20show%20client%20-%3E%20server%20and%20server%20-%3E%20client%20messages%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20const%20DEBUG_SERVER%20%3D%202%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Debug%20level%20to%20show%20connection%20status%2C%20client%20-%3E%20server%20and%20server%20-%3E%20client%20messages%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20const%20DEBUG_CONNECTION%20%3D%203%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Debug%20level%20to%20show%20all%20messages%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20const%20DEBUG_LOWLEVEL%20%3D%204%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20PHPMailer%20SMTP%20Version%20number.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%20%40deprecated%20Use%20the%20%60VERSION%60%20constant%20instead%0D%0A%20%20%20%20%20%2A%20%40see%20SMTP%3A%3AVERSION%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Version%20%3D%20%275.2.28%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20SMTP%20server%20port%20number.%0D%0A%20%20%20%20%20%2A%20%40var%20integer%0D%0A%20%20%20%20%20%2A%20%40deprecated%20This%20is%20only%20ever%20used%20as%20a%20default%20value%2C%20so%20use%20the%20%60DEFAULT_SMTP_PORT%60%20constant%20instead%0D%0A%20%20%20%20%20%2A%20%40see%20SMTP%3A%3ADEFAULT_SMTP_PORT%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24SMTP_PORT%20%3D%2025%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20SMTP%20reply%20line%20ending.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%20%40deprecated%20Use%20the%20%60CRLF%60%20constant%20instead%0D%0A%20%20%20%20%20%2A%20%40see%20SMTP%3A%3ACRLF%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24CRLF%20%3D%20%22%5Cr%5Cn%22%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Debug%20output%20level.%0D%0A%20%20%20%20%20%2A%20Options%3A%0D%0A%20%20%20%20%20%2A%20%2A%20self%3A%3ADEBUG_OFF%20%28%600%60%29%20No%20debug%20output%2C%20default%0D%0A%20%20%20%20%20%2A%20%2A%20self%3A%3ADEBUG_CLIENT%20%28%601%60%29%20Client%20commands%0D%0A%20%20%20%20%20%2A%20%2A%20self%3A%3ADEBUG_SERVER%20%28%602%60%29%20Client%20commands%20and%20server%20responses%0D%0A%20%20%20%20%20%2A%20%2A%20self%3A%3ADEBUG_CONNECTION%20%28%603%60%29%20As%20DEBUG_SERVER%20plus%20connection%20status%0D%0A%20%20%20%20%20%2A%20%2A%20self%3A%3ADEBUG_LOWLEVEL%20%28%604%60%29%20Low-level%20data%20output%2C%20all%20messages%0D%0A%20%20%20%20%20%2A%20%40var%20integer%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24do_debug%20%3D%20self%3A%3ADEBUG_OFF%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20How%20to%20handle%20debug%20output.%0D%0A%20%20%20%20%20%2A%20Options%3A%0D%0A%20%20%20%20%20%2A%20%2A%20%60echo%60%20Output%20plain-text%20as-is%2C%20appropriate%20for%20CLI%0D%0A%20%20%20%20%20%2A%20%2A%20%60html%60%20Output%20escaped%2C%20line%20breaks%20converted%20to%20%60%3Cbr%3E%60%2C%20appropriate%20for%20browser%20output%0D%0A%20%20%20%20%20%2A%20%2A%20%60error_log%60%20Output%20to%20error%20log%20as%20configured%20in%20php.ini%0D%0A%20%20%20%20%20%2A%0D%0A%20%20%20%20%20%2A%20Alternatively%2C%20you%20can%20provide%20a%20callable%20expecting%20two%20params%3A%20a%20message%20string%20and%20the%20debug%20level%3A%0D%0A%20%20%20%20%20%2A%20%3Ccode%3E%0D%0A%20%20%20%20%20%2A%20%24smtp-%3EDebugoutput%20%3D%20function%28%24str%2C%20%24level%29%20%7Becho%20%22debug%20level%20%24level%3B%20message%3A%20%24str%22%3B%7D%3B%0D%0A%20%20%20%20%20%2A%20%3C%2Fcode%3E%0D%0A%20%20%20%20%20%2A%20%40var%20string%7Ccallable%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Debugoutput%20%3D%20%27echo%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Whether%20to%20use%20VERP.%0D%0A%20%20%20%20%20%2A%20%40link%20http%3A%2F%2Fen.wikipedia.org%2Fwiki%2FVariable_envelope_return_path%0D%0A%20%20%20%20%20%2A%20%40link%20http%3A%2F%2Fwww.postfix.org%2FVERP_README.html%20Info%20on%20VERP%0D%0A%20%20%20%20%20%2A%20%40var%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24do_verp%20%3D%20false%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20timeout%20value%20for%20connection%2C%20in%20seconds.%0D%0A%20%20%20%20%20%2A%20Default%20of%205%20minutes%20%28300sec%29%20is%20from%20RFC2821%20section%204.5.3.2%0D%0A%20%20%20%20%20%2A%20This%20needs%20to%20be%20quite%20high%20to%20function%20correctly%20with%20hosts%20using%20greetdelay%20as%20an%20anti-spam%20measure.%0D%0A%20%20%20%20%20%2A%20%40link%20http%3A%2F%2Ftools.ietf.org%2Fhtml%2Frfc2821%23section-4.5.3.2%0D%0A%20%20%20%20%20%2A%20%40var%20integer%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Timeout%20%3D%20300%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20How%20long%20to%20wait%20for%20commands%20to%20complete%2C%20in%20seconds.%0D%0A%20%20%20%20%20%2A%20Default%20of%205%20minutes%20%28300sec%29%20is%20from%20RFC2821%20section%204.5.3.2%0D%0A%20%20%20%20%20%2A%20%40var%20integer%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Timelimit%20%3D%20300%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20%40var%20array%20Patterns%20to%20extract%20an%20SMTP%20transaction%20id%20from%20reply%20to%20a%20DATA%20command.%0D%0A%20%20%20%20%20%2A%20The%20first%20capture%20group%20in%20each%20regex%20will%20be%20used%20as%20the%20ID.%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24smtp_transaction_id_patterns%20%3D%20array%28%0D%0A%20%20%20%20%20%20%20%20%27exim%27%20%3D%3E%20%27%2F%5B0-9%5D%7B3%7D%20OK%20id%3D%28.%2A%29%2F%27%2C%0D%0A%20%20%20%20%20%20%20%20%27sendmail%27%20%3D%3E%20%27%2F%5B0-9%5D%7B3%7D%202.0.0%20%28.%2A%29%20Message%2F%27%2C%0D%0A%20%20%20%20%20%20%20%20%27postfix%27%20%3D%3E%20%27%2F%5B0-9%5D%7B3%7D%202.0.0%20Ok%3A%20queued%20as%20%28.%2A%29%2F%27%0D%0A%20%20%20%20%29%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20%40var%20string%20The%20last%20transaction%20ID%20issued%20in%20response%20to%20a%20DATA%20command%2C%0D%0A%20%20%20%20%20%2A%20if%20one%20was%20detected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24last_smtp_transaction_id%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20socket%20for%20the%20server%20connection.%0D%0A%20%20%20%20%20%2A%20%40var%20resource%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24smtp_conn%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Error%20information%2C%20if%20any%2C%20for%20the%20last%20SMTP%20command.%0D%0A%20%20%20%20%20%2A%20%40var%20array%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24error%20%3D%20array%28%0D%0A%20%20%20%20%20%20%20%20%27error%27%20%3D%3E%20%27%27%2C%0D%0A%20%20%20%20%20%20%20%20%27detail%27%20%3D%3E%20%27%27%2C%0D%0A%20%20%20%20%20%20%20%20%27smtp_code%27%20%3D%3E%20%27%27%2C%0D%0A%20%20%20%20%20%20%20%20%27smtp_code_ex%27%20%3D%3E%20%27%27%0D%0A%20%20%20%20%29%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20reply%20the%20server%20sent%20to%20us%20for%20HELO.%0D%0A%20%20%20%20%20%2A%20If%20null%2C%20no%20HELO%20string%20has%20yet%20been%20received.%0D%0A%20%20%20%20%20%2A%20%40var%20string%7Cnull%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24helo_rply%20%3D%20null%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20set%20of%20SMTP%20extensions%20sent%20in%20reply%20to%20EHLO%20command.%0D%0A%20%20%20%20%20%2A%20Indexes%20of%20the%20array%20are%20extension%20names.%0D%0A%20%20%20%20%20%2A%20Value%20at%20index%20%27HELO%27%20or%20%27EHLO%27%20%28according%20to%20command%20that%20was%20sent%29%0D%0A%20%20%20%20%20%2A%20represents%20the%20server%20name.%20In%20case%20of%20HELO%20it%20is%20the%20only%20element%20of%20the%20array.%0D%0A%20%20%20%20%20%2A%20Other%20values%20can%20be%20boolean%20TRUE%20or%20an%20array%20containing%20extension%20options.%0D%0A%20%20%20%20%20%2A%20If%20null%2C%20no%20HELO%2FEHLO%20string%20has%20yet%20been%20received.%0D%0A%20%20%20%20%20%2A%20%40var%20array%7Cnull%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24server_caps%20%3D%20null%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20most%20recent%20reply%20received%20from%20the%20server.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24last_reply%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Output%20debugging%20info%20via%20a%20user-selected%20method.%0D%0A%20%20%20%20%20%2A%20%40see%20SMTP%3A%3A%24Debugoutput%0D%0A%20%20%20%20%20%2A%20%40see%20SMTP%3A%3A%24do_debug%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24str%20Debug%20string%20to%20output%0D%0A%20%20%20%20%20%2A%20%40param%20integer%20%24level%20The%20debug%20level%20of%20this%20message%3B%20see%20DEBUG_%2A%20constants%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20edebug%28%24str%2C%20%24level%20%3D%200%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24level%20%3E%20%24this-%3Edo_debug%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2FAvoid%20clash%20with%20built-in%20function%20names%0D%0A%20%20%20%20%20%20%20%20if%20%28%21in_array%28%24this-%3EDebugoutput%2C%20array%28%27error_log%27%2C%20%27html%27%2C%20%27echo%27%29%29%20and%20is_callable%28%24this-%3EDebugoutput%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20call_user_func%28%24this-%3EDebugoutput%2C%20%24str%2C%20%24level%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20switch%20%28%24this-%3EDebugoutput%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27error_log%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FDon%27t%20output%2C%20just%20log%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20error_log%28%24str%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27html%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FCleans%20up%20output%20a%20bit%20for%20a%20better%20looking%2C%20HTML-safe%20output%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20gmdate%28%27Y-m-d%20H%3Ai%3As%27%29%20.%20%27%20%27%20.%20htmlentities%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20preg_replace%28%27%2F%5B%5Cr%5Cn%5D%2B%2F%27%2C%20%27%27%2C%20%24str%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ENT_QUOTES%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27UTF-8%27%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%20.%20%22%3Cbr%3E%5Cn%22%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27echo%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20default%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FNormalize%20line%20breaks%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24str%20%3D%20preg_replace%28%27%2F%28%5Cr%5Cn%7C%5Cr%7C%5Cn%29%2Fms%27%2C%20%22%5Cn%22%2C%20%24str%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20gmdate%28%27Y-m-d%20H%3Ai%3As%27%29%20.%20%22%5Ct%22%20.%20str_replace%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%5Cn%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ct%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20trim%28%24str%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%20.%20%22%5Cn%22%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Connect%20to%20an%20SMTP%20server.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24host%20SMTP%20server%20IP%20or%20host%20name%0D%0A%20%20%20%20%20%2A%20%40param%20integer%20%24port%20The%20port%20number%20to%20connect%20to%0D%0A%20%20%20%20%20%2A%20%40param%20integer%20%24timeout%20How%20long%20to%20wait%20for%20the%20connection%20to%20open%0D%0A%20%20%20%20%20%2A%20%40param%20array%20%24options%20An%20array%20of%20options%20for%20stream_context_create%28%29%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20connect%28%24host%2C%20%24port%20%3D%20null%2C%20%24timeout%20%3D%2030%2C%20%24options%20%3D%20array%28%29%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20static%20%24streamok%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2FThis%20is%20enabled%20by%20default%20since%205.0.0%20but%20some%20providers%20disable%20it%0D%0A%20%20%20%20%20%20%20%20%2F%2FCheck%20this%20once%20and%20cache%20the%20result%0D%0A%20%20%20%20%20%20%20%20if%20%28is_null%28%24streamok%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24streamok%20%3D%20function_exists%28%27stream_socket_client%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Clear%20errors%20to%20avoid%20confusion%0D%0A%20%20%20%20%20%20%20%20%24this-%3EsetError%28%27%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Make%20sure%20we%20are%20__not__%20connected%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3Econnected%28%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Already%20connected%2C%20generate%20error%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%27Already%20connected%20to%20a%20server%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28empty%28%24port%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24port%20%3D%20self%3A%3ADEFAULT_SMTP_PORT%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Connect%20to%20the%20SMTP%20server%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%22Connection%3A%20opening%20to%20%24host%3A%24port%2C%20timeout%3D%24timeout%2C%20options%3D%22%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20var_export%28%24options%2C%20true%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20self%3A%3ADEBUG_CONNECTION%0D%0A%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%24errno%20%3D%200%3B%0D%0A%20%20%20%20%20%20%20%20%24errstr%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24streamok%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24socket_context%20%3D%20stream_context_create%28%24options%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20set_error_handler%28array%28%24this%2C%20%27errorHandler%27%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Esmtp_conn%20%3D%20stream_socket_client%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24host%20.%20%22%3A%22%20.%20%24port%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24errno%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24errstr%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24timeout%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20STREAM_CLIENT_CONNECT%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24socket_context%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20restore_error_handler%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FFall%20back%20to%20fsockopen%20which%20should%20work%20in%20more%20places%2C%20but%20is%20missing%20some%20features%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Connection%3A%20stream_socket_client%20not%20available%2C%20falling%20back%20to%20fsockopen%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20self%3A%3ADEBUG_CONNECTION%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20set_error_handler%28array%28%24this%2C%20%27errorHandler%27%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Esmtp_conn%20%3D%20fsockopen%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24host%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24port%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24errno%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24errstr%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24timeout%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20restore_error_handler%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Verify%20we%20connected%20properly%0D%0A%20%20%20%20%20%20%20%20if%20%28%21is_resource%28%24this-%3Esmtp_conn%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27Failed%20to%20connect%20to%20server%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24errno%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24errstr%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27SMTP%20ERROR%3A%20%27%20.%20%24this-%3Eerror%5B%27error%27%5D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.%20%22%3A%20%24errstr%20%28%24errno%29%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20self%3A%3ADEBUG_CLIENT%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%27Connection%3A%20opened%27%2C%20self%3A%3ADEBUG_CONNECTION%29%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20SMTP%20server%20can%20take%20longer%20to%20respond%2C%20give%20longer%20timeout%20for%20first%20read%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Windows%20does%20not%20have%20support%20for%20this%20timeout%20function%0D%0A%20%20%20%20%20%20%20%20if%20%28substr%28PHP_OS%2C%200%2C%203%29%20%21%3D%20%27WIN%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24max%20%3D%20ini_get%28%27max_execution_time%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Don%27t%20bother%20if%20unlimited%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24max%20%21%3D%200%20%26%26%20%24timeout%20%3E%20%24max%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%40set_time_limit%28%24timeout%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20stream_set_timeout%28%24this-%3Esmtp_conn%2C%20%24timeout%2C%200%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Get%20any%20announcement%0D%0A%20%20%20%20%20%20%20%20%24announce%20%3D%20%24this-%3Eget_lines%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%27SERVER%20-%3E%20CLIENT%3A%20%27%20.%20%24announce%2C%20self%3A%3ADEBUG_SERVER%29%3B%0D%0A%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Initiate%20a%20TLS%20%28encrypted%29%20session.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20startTLS%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%21%24this-%3EsendCommand%28%27STARTTLS%27%2C%20%27STARTTLS%27%2C%20220%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2FAllow%20the%20best%20TLS%20version%28s%29%20we%20can%0D%0A%20%20%20%20%20%20%20%20%24crypto_method%20%3D%20STREAM_CRYPTO_METHOD_TLS_CLIENT%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2FPHP%205.6.7%20dropped%20inclusion%20of%20TLS%201.1%20and%201.2%20in%20STREAM_CRYPTO_METHOD_TLS_CLIENT%0D%0A%20%20%20%20%20%20%20%20%2F%2Fso%20add%20them%20back%20in%20manually%20if%20we%20can%0D%0A%20%20%20%20%20%20%20%20if%20%28defined%28%27STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24crypto_method%20%7C%3D%20STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24crypto_method%20%7C%3D%20STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Begin%20encrypted%20connection%0D%0A%20%20%20%20%20%20%20%20set_error_handler%28array%28%24this%2C%20%27errorHandler%27%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%24crypto_ok%20%3D%20stream_socket_enable_crypto%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Esmtp_conn%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20true%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24crypto_method%0D%0A%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20restore_error_handler%28%29%3B%0D%0A%20%20%20%20%20%20%20%20return%20%24crypto_ok%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Perform%20SMTP%20authentication.%0D%0A%20%20%20%20%20%2A%20Must%20be%20run%20after%20hello%28%29.%0D%0A%20%20%20%20%20%2A%20%40see%20hello%28%29%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24username%20The%20user%20name%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24password%20The%20password%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24authtype%20The%20auth%20type%20%28PLAIN%2C%20LOGIN%2C%20NTLM%2C%20CRAM-MD5%2C%20XOAUTH2%29%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24realm%20The%20auth%20realm%20for%20NTLM%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24workstation%20The%20auth%20workstation%20for%20NTLM%0D%0A%20%20%20%20%20%2A%20%40param%20null%7COAuth%20%24OAuth%20An%20optional%20OAuth%20instance%20%28%40see%20PHPMailerOAuth%29%0D%0A%20%20%20%20%20%2A%20%40return%20bool%20True%20if%20successfully%20authenticated.%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20authenticate%28%0D%0A%20%20%20%20%20%20%20%20%24username%2C%0D%0A%20%20%20%20%20%20%20%20%24password%2C%0D%0A%20%20%20%20%20%20%20%20%24authtype%20%3D%20null%2C%0D%0A%20%20%20%20%20%20%20%20%24realm%20%3D%20%27%27%2C%0D%0A%20%20%20%20%20%20%20%20%24workstation%20%3D%20%27%27%2C%0D%0A%20%20%20%20%20%20%20%20%24OAuth%20%3D%20null%0D%0A%20%20%20%20%29%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%21%24this-%3Eserver_caps%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%27Authentication%20is%20not%20allowed%20before%20HELO%2FEHLO%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20if%20%28array_key_exists%28%27EHLO%27%2C%20%24this-%3Eserver_caps%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20SMTP%20extensions%20are%20available%3B%20try%20to%20find%20a%20proper%20authentication%20method%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21array_key_exists%28%27AUTH%27%2C%20%24this-%3Eserver_caps%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%27Authentication%20is%20not%20allowed%20at%20this%20stage%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20%27at%20this%20stage%27%20means%20that%20auth%20may%20be%20allowed%20after%20the%20stage%20changes%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20e.g.%20after%20STARTTLS%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20self%3A%3Aedebug%28%27Auth%20method%20requested%3A%20%27%20.%20%28%24authtype%20%3F%20%24authtype%20%3A%20%27UNKNOWN%27%29%2C%20self%3A%3ADEBUG_LOWLEVEL%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20self%3A%3Aedebug%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27Auth%20methods%20available%20on%20the%20server%3A%20%27%20.%20implode%28%27%2C%27%2C%20%24this-%3Eserver_caps%5B%27AUTH%27%5D%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20self%3A%3ADEBUG_LOWLEVEL%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28empty%28%24authtype%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20foreach%20%28array%28%27CRAM-MD5%27%2C%20%27LOGIN%27%2C%20%27PLAIN%27%2C%20%27NTLM%27%2C%20%27XOAUTH2%27%29%20as%20%24method%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28in_array%28%24method%2C%20%24this-%3Eserver_caps%5B%27AUTH%27%5D%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24authtype%20%3D%20%24method%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28empty%28%24authtype%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%27No%20supported%20authentication%20methods%20found%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20self%3A%3Aedebug%28%27Auth%20method%20selected%3A%20%27%20.%20%24authtype%2C%20self%3A%3ADEBUG_LOWLEVEL%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21in_array%28%24authtype%2C%20%24this-%3Eserver_caps%5B%27AUTH%27%5D%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%22The%20requested%20authentication%20method%20%5C%22%24authtype%5C%22%20is%20not%20supported%20by%20the%20server%22%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%20elseif%20%28empty%28%24authtype%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24authtype%20%3D%20%27LOGIN%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20switch%20%28%24authtype%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27PLAIN%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Start%20authentication%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24this-%3EsendCommand%28%27AUTH%27%2C%20%27AUTH%20PLAIN%27%2C%20334%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Send%20encoded%20username%20and%20password%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24this-%3EsendCommand%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27User%20%26%20Password%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20base64_encode%28%22%5C0%22%20.%20%24username%20.%20%22%5C0%22%20.%20%24password%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20235%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27LOGIN%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Start%20authentication%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24this-%3EsendCommand%28%27AUTH%27%2C%20%27AUTH%20LOGIN%27%2C%20334%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24this-%3EsendCommand%28%22Username%22%2C%20base64_encode%28%24username%29%2C%20334%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24this-%3EsendCommand%28%22Password%22%2C%20base64_encode%28%24password%29%2C%20235%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27XOAUTH2%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FIf%20the%20OAuth%20Instance%20is%20not%20set.%20Can%20be%20a%20case%20when%20PHPMailer%20is%20used%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2Finstead%20of%20PHPMailerOAuth%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28is_null%28%24OAuth%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24oauth%20%3D%20%24OAuth-%3EgetOauth64%28%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Start%20authentication%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24this-%3EsendCommand%28%27AUTH%27%2C%20%27AUTH%20XOAUTH2%20%27%20.%20%24oauth%2C%20235%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27NTLM%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2A%20ntlm_sasl_client.php%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2A%20Bundled%20with%20Permission%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2A%20How%20to%20telnet%20in%20windows%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2A%20http%3A%2F%2Ftechnet.microsoft.com%2Fen-us%2Flibrary%2Faa995718%2528EXCHG.65%2529.aspx%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2A%20PROTOCOL%20Docs%20http%3A%2F%2Fcurl.haxx.se%2Frfc%2Fntlm.html%23ntlmSmtpAuthentication%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20require_once%20%27extras%2Fntlm_sasl_client.php%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24temp%20%3D%20new%20stdClass%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24ntlm_client%20%3D%20new%20ntlm_sasl_client_class%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FCheck%20that%20functions%20are%20available%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24ntlm_client-%3Einitialize%28%24temp%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%24temp-%3Eerror%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27You%20need%20to%20enable%20some%20modules%20in%20your%20php.ini%20file%3A%20%27%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.%20%24this-%3Eerror%5B%27error%27%5D%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20self%3A%3ADEBUG_CLIENT%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2Fmsg1%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24msg1%20%3D%20%24ntlm_client-%3EtypeMsg1%28%24realm%2C%20%24workstation%29%3B%20%2F%2Fmsg1%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24this-%3EsendCommand%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27AUTH%20NTLM%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27AUTH%20NTLM%20%27%20.%20base64_encode%28%24msg1%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20334%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FThough%200%20based%2C%20there%20is%20a%20white%20space%20after%20the%203%20digit%20number%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2Fmsg2%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24challenge%20%3D%20substr%28%24this-%3Elast_reply%2C%203%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24challenge%20%3D%20base64_decode%28%24challenge%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24ntlm_res%20%3D%20%24ntlm_client-%3ENTLMResponse%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20substr%28%24challenge%2C%2024%2C%208%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24password%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2Fmsg3%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24msg3%20%3D%20%24ntlm_client-%3EtypeMsg3%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24ntlm_res%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24username%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24realm%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24workstation%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20send%20encoded%20username%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%24this-%3EsendCommand%28%27Username%27%2C%20base64_encode%28%24msg3%29%2C%20235%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27CRAM-MD5%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Start%20authentication%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24this-%3EsendCommand%28%27AUTH%20CRAM-MD5%27%2C%20%27AUTH%20CRAM-MD5%27%2C%20334%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Get%20the%20challenge%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24challenge%20%3D%20base64_decode%28substr%28%24this-%3Elast_reply%2C%204%29%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Build%20the%20response%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24response%20%3D%20%24username%20.%20%27%20%27%20.%20%24this-%3Ehmac%28%24challenge%2C%20%24password%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20send%20encoded%20credentials%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%24this-%3EsendCommand%28%27Username%27%2C%20base64_encode%28%24response%29%2C%20235%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20default%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%22Authentication%20method%20%5C%22%24authtype%5C%22%20is%20not%20supported%22%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Calculate%20an%20MD5%20HMAC%20hash.%0D%0A%20%20%20%20%20%2A%20Works%20like%20hash_hmac%28%27md5%27%2C%20%24data%2C%20%24key%29%0D%0A%20%20%20%20%20%2A%20in%20case%20that%20function%20is%20not%20available%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24data%20The%20data%20to%20hash%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24key%20The%20key%20to%20hash%20with%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20hmac%28%24data%2C%20%24key%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28function_exists%28%27hash_hmac%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20hash_hmac%28%27md5%27%2C%20%24data%2C%20%24key%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20The%20following%20borrowed%20from%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20http%3A%2F%2Fphp.net%2Fmanual%2Fen%2Ffunction.mhash.php%2327225%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20RFC%202104%20HMAC%20implementation%20for%20php.%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Creates%20an%20md5%20HMAC.%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Eliminates%20the%20need%20to%20install%20mhash%20to%20compute%20a%20HMAC%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20by%20Lance%20Rushing%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24bytelen%20%3D%2064%3B%20%2F%2F%20byte%20length%20for%20md5%0D%0A%20%20%20%20%20%20%20%20if%20%28strlen%28%24key%29%20%3E%20%24bytelen%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24key%20%3D%20pack%28%27H%2A%27%2C%20md5%28%24key%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24key%20%3D%20str_pad%28%24key%2C%20%24bytelen%2C%20chr%280x00%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%24ipad%20%3D%20str_pad%28%27%27%2C%20%24bytelen%2C%20chr%280x36%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%24opad%20%3D%20str_pad%28%27%27%2C%20%24bytelen%2C%20chr%280x5c%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%24k_ipad%20%3D%20%24key%20%5E%20%24ipad%3B%0D%0A%20%20%20%20%20%20%20%20%24k_opad%20%3D%20%24key%20%5E%20%24opad%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20return%20md5%28%24k_opad%20.%20pack%28%27H%2A%27%2C%20md5%28%24k_ipad%20.%20%24data%29%29%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Check%20connection%20state.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%20True%20if%20connected.%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20connected%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28is_resource%28%24this-%3Esmtp_conn%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24sock_status%20%3D%20stream_get_meta_data%28%24this-%3Esmtp_conn%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24sock_status%5B%27eof%27%5D%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20The%20socket%20is%20valid%20but%20we%20are%20not%20connected%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27SMTP%20NOTICE%3A%20EOF%20caught%20while%20checking%20if%20connected%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20self%3A%3ADEBUG_CLIENT%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eclose%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20true%3B%20%2F%2F%20everything%20looks%20good%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Close%20the%20socket%20and%20clean%20up%20the%20state%20of%20the%20class.%0D%0A%20%20%20%20%20%2A%20Don%27t%20use%20this%20function%20without%20first%20trying%20to%20use%20QUIT.%0D%0A%20%20%20%20%20%2A%20%40see%20quit%28%29%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20close%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3EsetError%28%27%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eserver_caps%20%3D%20null%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Ehelo_rply%20%3D%20null%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28is_resource%28%24this-%3Esmtp_conn%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20close%20the%20connection%20and%20cleanup%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20fclose%28%24this-%3Esmtp_conn%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Esmtp_conn%20%3D%20null%3B%20%2F%2FMakes%20for%20cleaner%20serialization%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%27Connection%3A%20closed%27%2C%20self%3A%3ADEBUG_CONNECTION%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20an%20SMTP%20DATA%20command.%0D%0A%20%20%20%20%20%2A%20Issues%20a%20data%20command%20and%20sends%20the%20msg_data%20to%20the%20server%2C%0D%0A%20%20%20%20%20%2A%20finializing%20the%20mail%20transaction.%20%24msg_data%20is%20the%20message%0D%0A%20%20%20%20%20%2A%20that%20is%20to%20be%20send%20with%20the%20headers.%20Each%20header%20needs%20to%20be%0D%0A%20%20%20%20%20%2A%20on%20a%20single%20line%20followed%20by%20a%20%3CCRLF%3E%20with%20the%20message%20headers%0D%0A%20%20%20%20%20%2A%20and%20the%20message%20body%20being%20separated%20by%20and%20additional%20%3CCRLF%3E.%0D%0A%20%20%20%20%20%2A%20Implements%20rfc%20821%3A%20DATA%20%3CCRLF%3E%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24msg_data%20Message%20data%20to%20send%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20data%28%24msg_data%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2FThis%20will%20use%20the%20standard%20timelimit%0D%0A%20%20%20%20%20%20%20%20if%20%28%21%24this-%3EsendCommand%28%27DATA%27%2C%20%27DATA%27%2C%20354%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2A%20The%20server%20is%20ready%20to%20accept%20data%21%0D%0A%20%20%20%20%20%20%20%20%20%2A%20According%20to%20rfc821%20we%20should%20not%20send%20more%20than%201000%20characters%20on%20a%20single%20line%20%28including%20the%20CRLF%29%0D%0A%20%20%20%20%20%20%20%20%20%2A%20so%20we%20will%20break%20the%20data%20up%20into%20lines%20by%20%5Cr%20and%2For%20%5Cn%20then%20if%20needed%20we%20will%20break%20each%20of%20those%20into%0D%0A%20%20%20%20%20%20%20%20%20%2A%20smaller%20lines%20to%20fit%20within%20the%20limit.%0D%0A%20%20%20%20%20%20%20%20%20%2A%20We%20will%20also%20look%20for%20lines%20that%20start%20with%20a%20%27.%27%20and%20prepend%20an%20additional%20%27.%27.%0D%0A%20%20%20%20%20%20%20%20%20%2A%20NOTE%3A%20this%20does%20not%20count%20towards%20line-length%20limit.%0D%0A%20%20%20%20%20%20%20%20%20%2A%2F%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Normalize%20line%20breaks%20before%20exploding%0D%0A%20%20%20%20%20%20%20%20%24lines%20%3D%20explode%28%22%5Cn%22%2C%20str_replace%28array%28%22%5Cr%5Cn%22%2C%20%22%5Cr%22%29%2C%20%22%5Cn%22%2C%20%24msg_data%29%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2A%20To%20distinguish%20between%20a%20complete%20RFC822%20message%20and%20a%20plain%20message%20body%2C%20we%20check%20if%20the%20first%20field%0D%0A%20%20%20%20%20%20%20%20%20%2A%20of%20the%20first%20line%20%28%27%3A%27%20separated%29%20does%20not%20contain%20a%20space%20then%20it%20_should_%20be%20a%20header%20and%20we%20will%0D%0A%20%20%20%20%20%20%20%20%20%2A%20process%20all%20lines%20before%20a%20blank%20line%20as%20headers.%0D%0A%20%20%20%20%20%20%20%20%20%2A%2F%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24field%20%3D%20substr%28%24lines%5B0%5D%2C%200%2C%20strpos%28%24lines%5B0%5D%2C%20%27%3A%27%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%24in_headers%20%3D%20false%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%21empty%28%24field%29%20%26%26%20strpos%28%24field%2C%20%27%20%27%29%20%3D%3D%3D%20false%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24in_headers%20%3D%20true%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20foreach%20%28%24lines%20as%20%24line%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24lines_out%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24in_headers%20and%20%24line%20%3D%3D%20%27%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24in_headers%20%3D%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FBreak%20this%20line%20up%20into%20several%20smaller%20lines%20if%20it%27s%20too%20long%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FMicro-optimisation%3A%20isset%28%24str%5B%24len%5D%29%20is%20faster%20than%20%28strlen%28%24str%29%20%3E%20%24len%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20while%20%28isset%28%24line%5Bself%3A%3AMAX_LINE_LENGTH%5D%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FWorking%20backwards%2C%20try%20to%20find%20a%20space%20within%20the%20last%20MAX_LINE_LENGTH%20chars%20of%20the%20line%20to%20break%20on%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2Fso%20as%20to%20avoid%20breaking%20in%20the%20middle%20of%20a%20word%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24pos%20%3D%20strrpos%28substr%28%24line%2C%200%2C%20self%3A%3AMAX_LINE_LENGTH%29%2C%20%27%20%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FDeliberately%20matches%20both%20false%20and%200%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24pos%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FNo%20nice%20break%20found%2C%20add%20a%20hard%20break%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24pos%20%3D%20self%3A%3AMAX_LINE_LENGTH%20-%201%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24lines_out%5B%5D%20%3D%20substr%28%24line%2C%200%2C%20%24pos%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24line%20%3D%20substr%28%24line%2C%20%24pos%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FBreak%20at%20the%20found%20point%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24lines_out%5B%5D%20%3D%20substr%28%24line%2C%200%2C%20%24pos%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FMove%20along%20by%20the%20amount%20we%20dealt%20with%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24line%20%3D%20substr%28%24line%2C%20%24pos%20%2B%201%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FIf%20processing%20headers%20add%20a%20LWSP-char%20to%20the%20front%20of%20new%20line%20RFC822%20section%203.1.1%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24in_headers%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24line%20%3D%20%22%5Ct%22%20.%20%24line%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24lines_out%5B%5D%20%3D%20%24line%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FSend%20the%20lines%20to%20the%20server%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20foreach%20%28%24lines_out%20as%20%24line_out%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FRFC2821%20section%204.5.2%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21empty%28%24line_out%29%20and%20%24line_out%5B0%5D%20%3D%3D%20%27.%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24line_out%20%3D%20%27.%27%20.%20%24line_out%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eclient_send%28%24line_out%20.%20self%3A%3ACRLF%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2FMessage%20data%20has%20been%20sent%2C%20complete%20the%20command%0D%0A%20%20%20%20%20%20%20%20%2F%2FIncrease%20timelimit%20for%20end%20of%20DATA%20command%0D%0A%20%20%20%20%20%20%20%20%24savetimelimit%20%3D%20%24this-%3ETimelimit%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3ETimelimit%20%3D%20%24this-%3ETimelimit%20%2A%202%3B%0D%0A%20%20%20%20%20%20%20%20%24result%20%3D%20%24this-%3EsendCommand%28%27DATA%20END%27%2C%20%27.%27%2C%20250%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3ErecordLastTransactionID%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2FRestore%20timelimit%0D%0A%20%20%20%20%20%20%20%20%24this-%3ETimelimit%20%3D%20%24savetimelimit%3B%0D%0A%20%20%20%20%20%20%20%20return%20%24result%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20an%20SMTP%20HELO%20or%20EHLO%20command.%0D%0A%20%20%20%20%20%2A%20Used%20to%20identify%20the%20sending%20server%20to%20the%20receiving%20server.%0D%0A%20%20%20%20%20%2A%20This%20makes%20sure%20that%20client%20and%20server%20are%20in%20a%20known%20state.%0D%0A%20%20%20%20%20%2A%20Implements%20RFC%20821%3A%20HELO%20%3CSP%3E%20%3Cdomain%3E%20%3CCRLF%3E%0D%0A%20%20%20%20%20%2A%20and%20RFC%202821%20EHLO.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24host%20The%20host%20name%20or%20IP%20to%20connect%20to%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20hello%28%24host%20%3D%20%27%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2FTry%20extended%20hello%20first%20%28RFC%202821%29%0D%0A%20%20%20%20%20%20%20%20return%20%28boolean%29%28%24this-%3EsendHello%28%27EHLO%27%2C%20%24host%29%20or%20%24this-%3EsendHello%28%27HELO%27%2C%20%24host%29%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20an%20SMTP%20HELO%20or%20EHLO%20command.%0D%0A%20%20%20%20%20%2A%20Low-level%20implementation%20used%20by%20hello%28%29%0D%0A%20%20%20%20%20%2A%20%40see%20hello%28%29%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24hello%20The%20HELO%20string%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24host%20The%20hostname%20to%20say%20we%20are%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20sendHello%28%24hello%2C%20%24host%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24noerror%20%3D%20%24this-%3EsendCommand%28%24hello%2C%20%24hello%20.%20%27%20%27%20.%20%24host%2C%20250%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Ehelo_rply%20%3D%20%24this-%3Elast_reply%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24noerror%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EparseHelloFields%28%24hello%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eserver_caps%20%3D%20null%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%24noerror%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Parse%20a%20reply%20to%20HELO%2FEHLO%20command%20to%20discover%20server%20extensions.%0D%0A%20%20%20%20%20%2A%20In%20case%20of%20HELO%2C%20the%20only%20parameter%20that%20can%20be%20discovered%20is%20a%20server%20name.%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24type%20-%20%27HELO%27%20or%20%27EHLO%27%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20parseHelloFields%28%24type%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eserver_caps%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%24lines%20%3D%20explode%28%22%5Cn%22%2C%20%24this-%3Ehelo_rply%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20foreach%20%28%24lines%20as%20%24n%20%3D%3E%20%24s%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FFirst%204%20chars%20contain%20response%20code%20followed%20by%20-%20or%20space%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24s%20%3D%20trim%28substr%28%24s%2C%204%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28empty%28%24s%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24fields%20%3D%20explode%28%27%20%27%2C%20%24s%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21empty%28%24fields%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24n%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24name%20%3D%20%24type%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24fields%20%3D%20%24fields%5B0%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24name%20%3D%20array_shift%28%24fields%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20switch%20%28%24name%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20case%20%27SIZE%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24fields%20%3D%20%28%24fields%20%3F%20%24fields%5B0%5D%20%3A%200%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20case%20%27AUTH%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21is_array%28%24fields%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24fields%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24fields%20%3D%20true%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eserver_caps%5B%24name%5D%20%3D%20%24fields%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20an%20SMTP%20MAIL%20command.%0D%0A%20%20%20%20%20%2A%20Starts%20a%20mail%20transaction%20from%20the%20email%20address%20specified%20in%0D%0A%20%20%20%20%20%2A%20%24from.%20Returns%20true%20if%20successful%20or%20false%20otherwise.%20If%20True%0D%0A%20%20%20%20%20%2A%20the%20mail%20transaction%20is%20started%20and%20then%20one%20or%20more%20recipient%0D%0A%20%20%20%20%20%2A%20commands%20may%20be%20called%20followed%20by%20a%20data%20command.%0D%0A%20%20%20%20%20%2A%20Implements%20rfc%20821%3A%20MAIL%20%3CSP%3E%20FROM%3A%3Creverse-path%3E%20%3CCRLF%3E%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24from%20Source%20address%20of%20this%20message%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20mail%28%24from%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24useVerp%20%3D%20%28%24this-%3Edo_verp%20%3F%20%27%20XVERP%27%20%3A%20%27%27%29%3B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3EsendCommand%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27MAIL%20FROM%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27MAIL%20FROM%3A%3C%27%20.%20%24from%20.%20%27%3E%27%20.%20%24useVerp%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20250%0D%0A%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20an%20SMTP%20QUIT%20command.%0D%0A%20%20%20%20%20%2A%20Closes%20the%20socket%20if%20there%20is%20no%20error%20or%20the%20%24close_on_error%20argument%20is%20true.%0D%0A%20%20%20%20%20%2A%20Implements%20from%20rfc%20821%3A%20QUIT%20%3CCRLF%3E%0D%0A%20%20%20%20%20%2A%20%40param%20boolean%20%24close_on_error%20Should%20the%20connection%20close%20if%20an%20error%20occurs%3F%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20quit%28%24close_on_error%20%3D%20true%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24noerror%20%3D%20%24this-%3EsendCommand%28%27QUIT%27%2C%20%27QUIT%27%2C%20221%29%3B%0D%0A%20%20%20%20%20%20%20%20%24err%20%3D%20%24this-%3Eerror%3B%20%2F%2FSave%20any%20error%0D%0A%20%20%20%20%20%20%20%20if%20%28%24noerror%20or%20%24close_on_error%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eclose%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eerror%20%3D%20%24err%3B%20%2F%2FRestore%20any%20error%20from%20the%20quit%20command%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%24noerror%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20an%20SMTP%20RCPT%20command.%0D%0A%20%20%20%20%20%2A%20Sets%20the%20TO%20argument%20to%20%24toaddr.%0D%0A%20%20%20%20%20%2A%20Returns%20true%20if%20the%20recipient%20was%20accepted%20false%20if%20it%20was%20rejected.%0D%0A%20%20%20%20%20%2A%20Implements%20from%20rfc%20821%3A%20RCPT%20%3CSP%3E%20TO%3A%3Cforward-path%3E%20%3CCRLF%3E%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24address%20The%20address%20the%20message%20is%20being%20sent%20to%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20recipient%28%24address%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3EsendCommand%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27RCPT%20TO%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27RCPT%20TO%3A%3C%27%20.%20%24address%20.%20%27%3E%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20array%28250%2C%20251%29%0D%0A%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20an%20SMTP%20RSET%20command.%0D%0A%20%20%20%20%20%2A%20Abort%20any%20transaction%20that%20is%20currently%20in%20progress.%0D%0A%20%20%20%20%20%2A%20Implements%20rfc%20821%3A%20RSET%20%3CCRLF%3E%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%20True%20on%20success.%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20reset%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3EsendCommand%28%27RSET%27%2C%20%27RSET%27%2C%20250%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20a%20command%20to%20an%20SMTP%20server%20and%20check%20its%20return%20code.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24command%20The%20command%20name%20-%20not%20sent%20to%20the%20server%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24commandstring%20The%20actual%20command%20to%20send%0D%0A%20%20%20%20%20%2A%20%40param%20integer%7Carray%20%24expect%20One%20or%20more%20expected%20integer%20success%20codes%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%20True%20on%20success.%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20sendCommand%28%24command%2C%20%24commandstring%2C%20%24expect%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%21%24this-%3Econnected%28%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%22Called%20%24command%20without%20being%20connected%22%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2FReject%20line%20breaks%20in%20all%20commands%0D%0A%20%20%20%20%20%20%20%20if%20%28strpos%28%24commandstring%2C%20%22%5Cn%22%29%20%21%3D%3D%20false%20or%20strpos%28%24commandstring%2C%20%22%5Cr%22%29%20%21%3D%3D%20false%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%22Command%20%27%24command%27%20contained%20line%20breaks%22%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eclient_send%28%24commandstring%20.%20self%3A%3ACRLF%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24this-%3Elast_reply%20%3D%20%24this-%3Eget_lines%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Fetch%20SMTP%20code%20and%20possible%20error%20code%20explanation%0D%0A%20%20%20%20%20%20%20%20%24matches%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28preg_match%28%22%2F%5E%28%5B0-9%5D%7B3%7D%29%5B%20-%5D%28%3F%3A%28%5B0-9%5D%5C%5C.%5B0-9%5D%5C%5C.%5B0-9%5D%29%20%29%3F%2F%22%2C%20%24this-%3Elast_reply%2C%20%24matches%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24code%20%3D%20%24matches%5B1%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24code_ex%20%3D%20%28count%28%24matches%29%20%3E%202%20%3F%20%24matches%5B2%5D%20%3A%20null%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Cut%20off%20error%20code%20from%20each%20response%20line%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24detail%20%3D%20preg_replace%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%2F%7B%24code%7D%5B%20-%5D%22%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%28%24code_ex%20%3F%20str_replace%28%27.%27%2C%20%27%5C%5C.%27%2C%20%24code_ex%29%20.%20%27%20%27%20%3A%20%27%27%29%20.%20%22%2Fm%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Elast_reply%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Fall%20back%20to%20simple%20parsing%20if%20regex%20fails%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24code%20%3D%20substr%28%24this-%3Elast_reply%2C%200%2C%203%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24code_ex%20%3D%20null%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24detail%20%3D%20substr%28%24this-%3Elast_reply%2C%204%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%27SERVER%20-%3E%20CLIENT%3A%20%27%20.%20%24this-%3Elast_reply%2C%20self%3A%3ADEBUG_SERVER%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20if%20%28%21in_array%28%24code%2C%20%28array%29%24expect%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%24command%20command%20failed%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24detail%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24code%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24code_ex%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27SMTP%20ERROR%3A%20%27%20.%20%24this-%3Eerror%5B%27error%27%5D%20.%20%27%3A%20%27%20.%20%24this-%3Elast_reply%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20self%3A%3ADEBUG_CLIENT%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24this-%3EsetError%28%27%27%29%3B%0D%0A%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20an%20SMTP%20SAML%20command.%0D%0A%20%20%20%20%20%2A%20Starts%20a%20mail%20transaction%20from%20the%20email%20address%20specified%20in%20%24from.%0D%0A%20%20%20%20%20%2A%20Returns%20true%20if%20successful%20or%20false%20otherwise.%20If%20True%0D%0A%20%20%20%20%20%2A%20the%20mail%20transaction%20is%20started%20and%20then%20one%20or%20more%20recipient%0D%0A%20%20%20%20%20%2A%20commands%20may%20be%20called%20followed%20by%20a%20data%20command.%20This%20command%0D%0A%20%20%20%20%20%2A%20will%20send%20the%20message%20to%20the%20users%20terminal%20if%20they%20are%20logged%0D%0A%20%20%20%20%20%2A%20in%20and%20send%20them%20an%20email.%0D%0A%20%20%20%20%20%2A%20Implements%20rfc%20821%3A%20SAML%20%3CSP%3E%20FROM%3A%3Creverse-path%3E%20%3CCRLF%3E%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24from%20The%20address%20the%20message%20is%20from%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20sendAndMail%28%24from%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3EsendCommand%28%27SAML%27%2C%20%22SAML%20FROM%3A%24from%22%2C%20250%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20an%20SMTP%20VRFY%20command.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24name%20The%20name%20to%20verify%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20verify%28%24name%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3EsendCommand%28%27VRFY%27%2C%20%22VRFY%20%24name%22%2C%20array%28250%2C%20251%29%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20an%20SMTP%20NOOP%20command.%0D%0A%20%20%20%20%20%2A%20Used%20to%20keep%20keep-alives%20alive%2C%20doesn%27t%20actually%20do%20anything%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20noop%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3EsendCommand%28%27NOOP%27%2C%20%27NOOP%27%2C%20250%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20an%20SMTP%20TURN%20command.%0D%0A%20%20%20%20%20%2A%20This%20is%20an%20optional%20command%20for%20SMTP%20that%20this%20class%20does%20not%20support.%0D%0A%20%20%20%20%20%2A%20This%20method%20is%20here%20to%20make%20the%20RFC821%20Definition%20complete%20for%20this%20class%0D%0A%20%20%20%20%20%2A%20and%20_may_%20be%20implemented%20in%20future%0D%0A%20%20%20%20%20%2A%20Implements%20from%20rfc%20821%3A%20TURN%20%3CCRLF%3E%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20turn%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3EsetError%28%27The%20SMTP%20TURN%20command%20is%20not%20implemented%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%27SMTP%20NOTICE%3A%20%27%20.%20%24this-%3Eerror%5B%27error%27%5D%2C%20self%3A%3ADEBUG_CLIENT%29%3B%0D%0A%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20raw%20data%20to%20the%20server.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24data%20The%20data%20to%20send%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20integer%7Cboolean%20The%20number%20of%20bytes%20sent%20to%20the%20server%20or%20false%20on%20error%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20client_send%28%24data%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%22CLIENT%20-%3E%20SERVER%3A%20%24data%22%2C%20self%3A%3ADEBUG_CLIENT%29%3B%0D%0A%20%20%20%20%20%20%20%20set_error_handler%28array%28%24this%2C%20%27errorHandler%27%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%24result%20%3D%20fwrite%28%24this-%3Esmtp_conn%2C%20%24data%29%3B%0D%0A%20%20%20%20%20%20%20%20restore_error_handler%28%29%3B%0D%0A%20%20%20%20%20%20%20%20return%20%24result%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Get%20the%20latest%20error.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20array%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getError%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3Eerror%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Get%20SMTP%20extensions%20available%20on%20the%20server%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20array%7Cnull%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getServerExtList%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3Eserver_caps%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20A%20multipurpose%20method%0D%0A%20%20%20%20%20%2A%20The%20method%20works%20in%20three%20ways%2C%20dependent%20on%20argument%20value%20and%20current%20state%0D%0A%20%20%20%20%20%2A%20%20%201.%20HELO%2FEHLO%20was%20not%20sent%20-%20returns%20null%20and%20set%20up%20%24this-%3Eerror%0D%0A%20%20%20%20%20%2A%20%20%202.%20HELO%20was%20sent%0D%0A%20%20%20%20%20%2A%20%20%20%20%20%24name%20%3D%20%27HELO%27%3A%20returns%20server%20name%0D%0A%20%20%20%20%20%2A%20%20%20%20%20%24name%20%3D%20%27EHLO%27%3A%20returns%20boolean%20false%0D%0A%20%20%20%20%20%2A%20%20%20%20%20%24name%20%3D%20any%20string%3A%20returns%20null%20and%20set%20up%20%24this-%3Eerror%0D%0A%20%20%20%20%20%2A%20%20%203.%20EHLO%20was%20sent%0D%0A%20%20%20%20%20%2A%20%20%20%20%20%24name%20%3D%20%27HELO%27%7C%27EHLO%27%3A%20returns%20server%20name%0D%0A%20%20%20%20%20%2A%20%20%20%20%20%24name%20%3D%20any%20string%3A%20if%20extension%20%24name%20exists%2C%20returns%20boolean%20True%0D%0A%20%20%20%20%20%2A%20%20%20%20%20%20%20or%20its%20options.%20Otherwise%20returns%20boolean%20False%0D%0A%20%20%20%20%20%2A%20In%20other%20words%2C%20one%20can%20use%20this%20method%20to%20detect%203%20conditions%3A%0D%0A%20%20%20%20%20%2A%20%20-%20null%20returned%3A%20handshake%20was%20not%20or%20we%20don%27t%20know%20about%20ext%20%28refer%20to%20%24this-%3Eerror%29%0D%0A%20%20%20%20%20%2A%20%20-%20false%20returned%3A%20the%20requested%20feature%20exactly%20not%20exists%0D%0A%20%20%20%20%20%2A%20%20-%20positive%20value%20returned%3A%20the%20requested%20feature%20exists%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24name%20Name%20of%20SMTP%20extension%20or%20%27HELO%27%7C%27EHLO%27%0D%0A%20%20%20%20%20%2A%20%40return%20mixed%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getServerExt%28%24name%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%21%24this-%3Eserver_caps%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%27No%20HELO%2FEHLO%20was%20sent%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20null%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20the%20tight%20logic%20knot%20%3B%29%0D%0A%20%20%20%20%20%20%20%20if%20%28%21array_key_exists%28%24name%2C%20%24this-%3Eserver_caps%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24name%20%3D%3D%20%27HELO%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%24this-%3Eserver_caps%5B%27EHLO%27%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24name%20%3D%3D%20%27EHLO%27%20%7C%7C%20array_key_exists%28%27EHLO%27%2C%20%24this-%3Eserver_caps%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%27HELO%20handshake%20was%20used.%20Client%20knows%20nothing%20about%20server%20extensions%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20null%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3Eserver_caps%5B%24name%5D%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Get%20the%20last%20reply%20from%20the%20server.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getLastReply%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3Elast_reply%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Read%20the%20SMTP%20server%27s%20response.%0D%0A%20%20%20%20%20%2A%20Either%20before%20eof%20or%20socket%20timeout%20occurs%20on%20the%20operation.%0D%0A%20%20%20%20%20%2A%20With%20SMTP%20we%20can%20tell%20if%20we%20have%20more%20lines%20to%20read%20if%20the%0D%0A%20%20%20%20%20%2A%204th%20character%20is%20%27-%27%20symbol.%20If%20it%20is%20a%20space%20then%20we%20don%27t%0D%0A%20%20%20%20%20%2A%20need%20to%20read%20anything%20else.%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20get_lines%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20If%20the%20connection%20is%20bad%2C%20give%20up%20straight%20away%0D%0A%20%20%20%20%20%20%20%20if%20%28%21is_resource%28%24this-%3Esmtp_conn%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24data%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%24endtime%20%3D%200%3B%0D%0A%20%20%20%20%20%20%20%20stream_set_timeout%28%24this-%3Esmtp_conn%2C%20%24this-%3ETimeout%29%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3ETimelimit%20%3E%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24endtime%20%3D%20time%28%29%20%2B%20%24this-%3ETimelimit%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20while%20%28is_resource%28%24this-%3Esmtp_conn%29%20%26%26%20%21feof%28%24this-%3Esmtp_conn%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24str%20%3D%20%40fgets%28%24this-%3Esmtp_conn%2C%20515%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%22SMTP%20-%3E%20get_lines%28%29%3A%20%5C%24data%20is%20%5C%22%24data%5C%22%22%2C%20self%3A%3ADEBUG_LOWLEVEL%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%22SMTP%20-%3E%20get_lines%28%29%3A%20%5C%24str%20is%20%20%5C%22%24str%5C%22%22%2C%20self%3A%3ADEBUG_LOWLEVEL%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24data%20.%3D%20%24str%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20If%20response%20is%20only%203%20chars%20%28not%20valid%2C%20but%20RFC5321%20S4.2%20says%20it%20must%20be%20handled%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20or%204th%20character%20is%20a%20space%2C%20we%20are%20done%20reading%2C%20break%20the%20loop%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20string%20array%20access%20is%20a%20micro-optimisation%20over%20strlen%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21isset%28%24str%5B3%5D%29%20or%20%28isset%28%24str%5B3%5D%29%20and%20%24str%5B3%5D%20%3D%3D%20%27%20%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Timed-out%3F%20Log%20and%20break%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24info%20%3D%20stream_get_meta_data%28%24this-%3Esmtp_conn%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24info%5B%27timed_out%27%5D%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27SMTP%20-%3E%20get_lines%28%29%3A%20timed-out%20%28%27%20.%20%24this-%3ETimeout%20.%20%27%20sec%29%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20self%3A%3ADEBUG_LOWLEVEL%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Now%20check%20if%20reads%20took%20too%20long%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24endtime%20and%20time%28%29%20%3E%20%24endtime%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27SMTP%20-%3E%20get_lines%28%29%3A%20timelimit%20reached%20%28%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ETimelimit%20.%20%27%20sec%29%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20self%3A%3ADEBUG_LOWLEVEL%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%24data%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Enable%20or%20disable%20VERP%20address%20generation.%0D%0A%20%20%20%20%20%2A%20%40param%20boolean%20%24enabled%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20setVerp%28%24enabled%20%3D%20false%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Edo_verp%20%3D%20%24enabled%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Get%20VERP%20address%20generation%20mode.%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getVerp%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3Edo_verp%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Set%20error%20messages%20and%20codes.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24message%20The%20error%20message%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24detail%20Further%20detail%20on%20the%20error%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24smtp_code%20An%20associated%20SMTP%20error%20code%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24smtp_code_ex%20Extended%20SMTP%20code%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20setError%28%24message%2C%20%24detail%20%3D%20%27%27%2C%20%24smtp_code%20%3D%20%27%27%2C%20%24smtp_code_ex%20%3D%20%27%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eerror%20%3D%20array%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27error%27%20%3D%3E%20%24message%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27detail%27%20%3D%3E%20%24detail%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27smtp_code%27%20%3D%3E%20%24smtp_code%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27smtp_code_ex%27%20%3D%3E%20%24smtp_code_ex%0D%0A%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Set%20debug%20output%20method.%0D%0A%20%20%20%20%20%2A%20%40param%20string%7Ccallable%20%24method%20The%20name%20of%20the%20mechanism%20to%20use%20for%20debugging%20output%2C%20or%20a%20callable%20to%20handle%20it.%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20setDebugOutput%28%24method%20%3D%20%27echo%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3EDebugoutput%20%3D%20%24method%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Get%20debug%20output%20method.%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getDebugOutput%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3EDebugoutput%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Set%20debug%20output%20level.%0D%0A%20%20%20%20%20%2A%20%40param%20integer%20%24level%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20setDebugLevel%28%24level%20%3D%200%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Edo_debug%20%3D%20%24level%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Get%20debug%20output%20level.%0D%0A%20%20%20%20%20%2A%20%40return%20integer%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getDebugLevel%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3Edo_debug%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Set%20SMTP%20timeout.%0D%0A%20%20%20%20%20%2A%20%40param%20integer%20%24timeout%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20setTimeout%28%24timeout%20%3D%200%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3ETimeout%20%3D%20%24timeout%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Get%20SMTP%20timeout.%0D%0A%20%20%20%20%20%2A%20%40return%20integer%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getTimeout%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3ETimeout%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Reports%20an%20error%20number%20and%20string.%0D%0A%20%20%20%20%20%2A%20%40param%20integer%20%24errno%20The%20error%20number%20returned%20by%20PHP.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24errmsg%20The%20error%20message%20returned%20by%20PHP.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24errfile%20The%20file%20the%20error%20occurred%20in%0D%0A%20%20%20%20%20%2A%20%40param%20integer%20%24errline%20The%20line%20number%20the%20error%20occurred%20on%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20errorHandler%28%24errno%2C%20%24errmsg%2C%20%24errfile%20%3D%20%27%27%2C%20%24errline%20%3D%200%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24notice%20%3D%20%27Connection%20failed.%27%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3EsetError%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24notice%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24errno%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24errmsg%0D%0A%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24notice%20.%20%27%20Error%20%23%27%20.%20%24errno%20.%20%27%3A%20%27%20.%20%24errmsg%20.%20%22%20%5B%24errfile%20line%20%24errline%5D%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20self%3A%3ADEBUG_CONNECTION%0D%0A%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Extract%20and%20return%20the%20ID%20of%20the%20last%20SMTP%20transaction%20based%20on%0D%0A%20%20%20%20%20%2A%20a%20list%20of%20patterns%20provided%20in%20SMTP%3A%3A%24smtp_transaction_id_patterns.%0D%0A%20%20%20%20%20%2A%20Relies%20on%20the%20host%20providing%20the%20ID%20in%20response%20to%20a%20DATA%20command.%0D%0A%20%20%20%20%20%2A%20If%20no%20reply%20has%20been%20received%20yet%2C%20it%20will%20return%20null.%0D%0A%20%20%20%20%20%2A%20If%20no%20pattern%20was%20matched%2C%20it%20will%20return%20false.%0D%0A%20%20%20%20%20%2A%20%40return%20bool%7Cnull%7Cstring%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20recordLastTransactionID%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24reply%20%3D%20%24this-%3EgetLastReply%28%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20if%20%28empty%28%24reply%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Elast_smtp_transaction_id%20%3D%20null%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Elast_smtp_transaction_id%20%3D%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20foreach%20%28%24this-%3Esmtp_transaction_id_patterns%20as%20%24smtp_transaction_id_pattern%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28preg_match%28%24smtp_transaction_id_pattern%2C%20%24reply%2C%20%24matches%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Elast_smtp_transaction_id%20%3D%20%24matches%5B1%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3Elast_smtp_transaction_id%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Get%20the%20queue%2Ftransaction%20ID%20of%20the%20last%20SMTP%20transaction%0D%0A%20%20%20%20%20%2A%20If%20no%20reply%20has%20been%20received%20yet%2C%20it%20will%20return%20null.%0D%0A%20%20%20%20%20%2A%20If%20no%20pattern%20was%20matched%2C%20it%20will%20return%20false.%0D%0A%20%20%20%20%20%2A%20%40return%20bool%7Cnull%7Cstring%0D%0A%20%20%20%20%20%2A%20%40see%20recordLastTransactionID%28%29%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getLastTransactionID%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3Elast_smtp_transaction_id%3B%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%3F%3E%0D%0A%3C%3Fphp%0D%0A%2F%2A%2A%0D%0A%20%2A%20PHPMailer%20-%20PHP%20email%20creation%20and%20transport%20class.%0D%0A%20%2A%20PHP%20Version%205%0D%0A%20%2A%20%40package%20PHPMailer%0D%0A%20%2A%20%40link%20https%3A%2F%2Fgithub.com%2FPHPMailer%2FPHPMailer%2F%20The%20PHPMailer%20GitHub%20project%0D%0A%20%2A%20%40author%20Marcus%20Bointon%20%28Synchro%2Fcoolbru%29%20%3Cphpmailer%40synchromedia.co.uk%3E%0D%0A%20%2A%20%40author%20Jim%20Jagielski%20%28jimjag%29%20%3Cjimjag%40gmail.com%3E%0D%0A%20%2A%20%40author%20Andy%20Prevost%20%28codeworxtech%29%20%3Ccodeworxtech%40users.sourceforge.net%3E%0D%0A%20%2A%20%40author%20Brent%20R.%20Matzelle%20%28original%20founder%29%0D%0A%20%2A%20%40copyright%202012%20-%202014%20Marcus%20Bointon%0D%0A%20%2A%20%40copyright%202010%20-%202012%20Jim%20Jagielski%0D%0A%20%2A%20%40copyright%202004%20-%202009%20Andy%20Prevost%0D%0A%20%2A%20%40license%20http%3A%2F%2Fwww.gnu.org%2Fcopyleft%2Flesser.html%20GNU%20Lesser%20General%20Public%20License%0D%0A%20%2A%20%40note%20This%20program%20is%20distributed%20in%20the%20hope%20that%20it%20will%20be%20useful%20-%20WITHOUT%0D%0A%20%2A%20ANY%20WARRANTY%3B%20without%20even%20the%20implied%20warranty%20of%20MERCHANTABILITY%20or%0D%0A%20%2A%20FITNESS%20FOR%20A%20PARTICULAR%20PURPOSE.%0D%0A%20%2A%2F%0D%0A%0D%0A%2F%2A%2A%0D%0A%20%2A%20PHPMailer%20-%20PHP%20email%20creation%20and%20transport%20class.%0D%0A%20%2A%20%40package%20PHPMailer%0D%0A%20%2A%20%40author%20Marcus%20Bointon%20%28Synchro%2Fcoolbru%29%20%3Cphpmailer%40synchromedia.co.uk%3E%0D%0A%20%2A%20%40author%20Jim%20Jagielski%20%28jimjag%29%20%3Cjimjag%40gmail.com%3E%0D%0A%20%2A%20%40author%20Andy%20Prevost%20%28codeworxtech%29%20%3Ccodeworxtech%40users.sourceforge.net%3E%0D%0A%20%2A%20%40author%20Brent%20R.%20Matzelle%20%28original%20founder%29%0D%0A%20%2A%2F%0D%0Aclass%20PHPMailer%0D%0A%7B%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20PHPMailer%20Version%20number.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Version%20%3D%20%275.2.28%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Email%20priority.%0D%0A%20%20%20%20%20%2A%20Options%3A%20null%20%28default%29%2C%201%20%3D%20High%2C%203%20%3D%20Normal%2C%205%20%3D%20low.%0D%0A%20%20%20%20%20%2A%20When%20null%2C%20the%20header%20is%20not%20set%20at%20all.%0D%0A%20%20%20%20%20%2A%20%40var%20integer%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Priority%20%3D%20null%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20character%20set%20of%20the%20message.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24CharSet%20%3D%20%27iso-8859-1%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20MIME%20Content-type%20of%20the%20message.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24ContentType%20%3D%20%27text%2Fplain%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20message%20encoding.%0D%0A%20%20%20%20%20%2A%20Options%3A%20%228bit%22%2C%20%227bit%22%2C%20%22binary%22%2C%20%22base64%22%2C%20and%20%22quoted-printable%22.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Encoding%20%3D%20%278bit%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Holds%20the%20most%20recent%20mailer%20error%20message.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24ErrorInfo%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20From%20email%20address%20for%20the%20message.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24From%20%3D%20%27root%40localhost%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20From%20name%20of%20the%20message.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24FromName%20%3D%20%27Root%20User%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20Sender%20email%20%28Return-Path%29%20of%20the%20message.%0D%0A%20%20%20%20%20%2A%20If%20not%20empty%2C%20will%20be%20sent%20via%20-f%20to%20sendmail%20or%20as%20%27MAIL%20FROM%27%20in%20smtp%20mode.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Sender%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20Return-Path%20of%20the%20message.%0D%0A%20%20%20%20%20%2A%20If%20empty%2C%20it%20will%20be%20set%20to%20either%20From%20or%20Sender.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%20%40deprecated%20Email%20senders%20should%20never%20set%20a%20return-path%20header%3B%0D%0A%20%20%20%20%20%2A%20it%27s%20the%20receiver%27s%20job%20%28RFC5321%20section%204.4%29%2C%20so%20this%20no%20longer%20does%20anything.%0D%0A%20%20%20%20%20%2A%20%40link%20https%3A%2F%2Ftools.ietf.org%2Fhtml%2Frfc5321%23section-4.4%20RFC5321%20reference%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24ReturnPath%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20Subject%20of%20the%20message.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Subject%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20An%20HTML%20or%20plain%20text%20message%20body.%0D%0A%20%20%20%20%20%2A%20If%20HTML%20then%20call%20isHTML%28true%29.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Body%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20plain-text%20message%20body.%0D%0A%20%20%20%20%20%2A%20This%20body%20can%20be%20read%20by%20mail%20clients%20that%20do%20not%20have%20HTML%20email%0D%0A%20%20%20%20%20%2A%20capability%20such%20as%20mutt%20%26%20Eudora.%0D%0A%20%20%20%20%20%2A%20Clients%20that%20can%20read%20HTML%20will%20view%20the%20normal%20Body.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24AltBody%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20An%20iCal%20message%20part%20body.%0D%0A%20%20%20%20%20%2A%20Only%20supported%20in%20simple%20alt%20or%20alt_inline%20message%20types%0D%0A%20%20%20%20%20%2A%20To%20generate%20iCal%20events%2C%20use%20the%20bundled%20extras%2FEasyPeasyICS.php%20class%20or%20iCalcreator%0D%0A%20%20%20%20%20%2A%20%40link%20http%3A%2F%2Fsprain.ch%2Fblog%2Fdownloads%2Fphp-class-easypeasyics-create-ical-files-with-php%2F%0D%0A%20%20%20%20%20%2A%20%40link%20http%3A%2F%2Fkigkonsult.se%2FiCalcreator%2F%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Ical%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20complete%20compiled%20MIME%20message%20body.%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24MIMEBody%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20complete%20compiled%20MIME%20message%20headers.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24MIMEHeader%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Extra%20headers%20that%20createHeader%28%29%20doesn%27t%20fold%20in.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24mailHeader%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Word-wrap%20the%20message%20body%20to%20this%20number%20of%20chars.%0D%0A%20%20%20%20%20%2A%20Set%20to%200%20to%20not%20wrap.%20A%20useful%20value%20here%20is%2078%2C%20for%20RFC2822%20section%202.1.1%20compliance.%0D%0A%20%20%20%20%20%2A%20%40var%20integer%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24WordWrap%20%3D%200%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Which%20method%20to%20use%20to%20send%20mail.%0D%0A%20%20%20%20%20%2A%20Options%3A%20%22mail%22%2C%20%22sendmail%22%2C%20or%20%22smtp%22.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Mailer%20%3D%20%27mail%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20path%20to%20the%20sendmail%20program.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Sendmail%20%3D%20%27%2Fusr%2Fsbin%2Fsendmail%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Whether%20mail%28%29%20uses%20a%20fully%20sendmail-compatible%20MTA.%0D%0A%20%20%20%20%20%2A%20One%20which%20supports%20sendmail%27s%20%22-oi%20-f%22%20options.%0D%0A%20%20%20%20%20%2A%20%40var%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24UseSendmailOptions%20%3D%20true%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Path%20to%20PHPMailer%20plugins.%0D%0A%20%20%20%20%20%2A%20Useful%20if%20the%20SMTP%20class%20is%20not%20in%20the%20PHP%20include%20path.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%20%40deprecated%20Should%20not%20be%20needed%20now%20there%20is%20an%20autoloader.%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24PluginDir%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20email%20address%20that%20a%20reading%20confirmation%20should%20be%20sent%20to%2C%20also%20known%20as%20read%20receipt.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24ConfirmReadingTo%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20hostname%20to%20use%20in%20the%20Message-ID%20header%20and%20as%20default%20HELO%20string.%0D%0A%20%20%20%20%20%2A%20If%20empty%2C%20PHPMailer%20attempts%20to%20find%20one%20with%2C%20in%20order%2C%0D%0A%20%20%20%20%20%2A%20%24_SERVER%5B%27SERVER_NAME%27%5D%2C%20gethostname%28%29%2C%20php_uname%28%27n%27%29%2C%20or%20the%20value%0D%0A%20%20%20%20%20%2A%20%27localhost.localdomain%27.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Hostname%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20An%20ID%20to%20be%20used%20in%20the%20Message-ID%20header.%0D%0A%20%20%20%20%20%2A%20If%20empty%2C%20a%20unique%20id%20will%20be%20generated.%0D%0A%20%20%20%20%20%2A%20You%20can%20set%20your%20own%2C%20but%20it%20must%20be%20in%20the%20format%20%22%3Cid%40domain%3E%22%2C%0D%0A%20%20%20%20%20%2A%20as%20defined%20in%20RFC5322%20section%203.6.4%20or%20it%20will%20be%20ignored.%0D%0A%20%20%20%20%20%2A%20%40see%20https%3A%2F%2Ftools.ietf.org%2Fhtml%2Frfc5322%23section-3.6.4%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24MessageID%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20message%20Date%20to%20be%20used%20in%20the%20Date%20header.%0D%0A%20%20%20%20%20%2A%20If%20empty%2C%20the%20current%20date%20will%20be%20added.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24MessageDate%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20SMTP%20hosts.%0D%0A%20%20%20%20%20%2A%20Either%20a%20single%20hostname%20or%20multiple%20semicolon-delimited%20hostnames.%0D%0A%20%20%20%20%20%2A%20You%20can%20also%20specify%20a%20different%20port%0D%0A%20%20%20%20%20%2A%20for%20each%20host%20by%20using%20this%20format%3A%20%5Bhostname%3Aport%5D%0D%0A%20%20%20%20%20%2A%20%28e.g.%20%22smtp1.example.com%3A25%3Bsmtp2.example.com%22%29.%0D%0A%20%20%20%20%20%2A%20You%20can%20also%20specify%20encryption%20type%2C%20for%20example%3A%0D%0A%20%20%20%20%20%2A%20%28e.g.%20%22tls%3A%2F%2Fsmtp1.example.com%3A587%3Bssl%3A%2F%2Fsmtp2.example.com%3A465%22%29.%0D%0A%20%20%20%20%20%2A%20Hosts%20will%20be%20tried%20in%20order.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Host%20%3D%20%27localhost%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20default%20SMTP%20server%20port.%0D%0A%20%20%20%20%20%2A%20%40var%20integer%0D%0A%20%20%20%20%20%2A%20%40TODO%20Why%20is%20this%20needed%20when%20the%20SMTP%20class%20takes%20care%20of%20it%3F%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Port%20%3D%2025%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20SMTP%20HELO%20of%20the%20message.%0D%0A%20%20%20%20%20%2A%20Default%20is%20%24Hostname.%20If%20%24Hostname%20is%20empty%2C%20PHPMailer%20attempts%20to%20find%0D%0A%20%20%20%20%20%2A%20one%20with%20the%20same%20method%20described%20above%20for%20%24Hostname.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%20%40see%20PHPMailer%3A%3A%24Hostname%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Helo%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20What%20kind%20of%20encryption%20to%20use%20on%20the%20SMTP%20connection.%0D%0A%20%20%20%20%20%2A%20Options%3A%20%27%27%2C%20%27ssl%27%20or%20%27tls%27%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24SMTPSecure%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Whether%20to%20enable%20TLS%20encryption%20automatically%20if%20a%20server%20supports%20it%2C%0D%0A%20%20%20%20%20%2A%20even%20if%20%60SMTPSecure%60%20is%20not%20set%20to%20%27tls%27.%0D%0A%20%20%20%20%20%2A%20Be%20aware%20that%20in%20PHP%20%3E%3D%205.6%20this%20requires%20that%20the%20server%27s%20certificates%20are%20valid.%0D%0A%20%20%20%20%20%2A%20%40var%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24SMTPAutoTLS%20%3D%20true%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Whether%20to%20use%20SMTP%20authentication.%0D%0A%20%20%20%20%20%2A%20Uses%20the%20Username%20and%20Password%20properties.%0D%0A%20%20%20%20%20%2A%20%40var%20boolean%0D%0A%20%20%20%20%20%2A%20%40see%20PHPMailer%3A%3A%24Username%0D%0A%20%20%20%20%20%2A%20%40see%20PHPMailer%3A%3A%24Password%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24SMTPAuth%20%3D%20false%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Options%20array%20passed%20to%20stream_context_create%20when%20connecting%20via%20SMTP.%0D%0A%20%20%20%20%20%2A%20%40var%20array%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24SMTPOptions%20%3D%20array%28%29%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20SMTP%20username.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Username%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20SMTP%20password.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Password%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20SMTP%20auth%20type.%0D%0A%20%20%20%20%20%2A%20Options%20are%20CRAM-MD5%2C%20LOGIN%2C%20PLAIN%2C%20NTLM%2C%20XOAUTH2%2C%20attempted%20in%20that%20order%20if%20not%20specified%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24AuthType%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20SMTP%20realm.%0D%0A%20%20%20%20%20%2A%20Used%20for%20NTLM%20auth%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Realm%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20SMTP%20workstation.%0D%0A%20%20%20%20%20%2A%20Used%20for%20NTLM%20auth%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Workstation%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20SMTP%20server%20timeout%20in%20seconds.%0D%0A%20%20%20%20%20%2A%20Default%20of%205%20minutes%20%28300sec%29%20is%20from%20RFC2821%20section%204.5.3.2%0D%0A%20%20%20%20%20%2A%20%40var%20integer%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Timeout%20%3D%20300%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20SMTP%20class%20debug%20output%20mode.%0D%0A%20%20%20%20%20%2A%20Debug%20output%20level.%0D%0A%20%20%20%20%20%2A%20Options%3A%0D%0A%20%20%20%20%20%2A%20%2A%20%600%60%20No%20output%0D%0A%20%20%20%20%20%2A%20%2A%20%601%60%20Commands%0D%0A%20%20%20%20%20%2A%20%2A%20%602%60%20Data%20and%20commands%0D%0A%20%20%20%20%20%2A%20%2A%20%603%60%20As%202%20plus%20connection%20status%0D%0A%20%20%20%20%20%2A%20%2A%20%604%60%20Low-level%20data%20output%0D%0A%20%20%20%20%20%2A%20%40var%20integer%0D%0A%20%20%20%20%20%2A%20%40see%20SMTP%3A%3A%24do_debug%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24SMTPDebug%20%3D%200%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20How%20to%20handle%20debug%20output.%0D%0A%20%20%20%20%20%2A%20Options%3A%0D%0A%20%20%20%20%20%2A%20%2A%20%60echo%60%20Output%20plain-text%20as-is%2C%20appropriate%20for%20CLI%0D%0A%20%20%20%20%20%2A%20%2A%20%60html%60%20Output%20escaped%2C%20line%20breaks%20converted%20to%20%60%3Cbr%3E%60%2C%20appropriate%20for%20browser%20output%0D%0A%20%20%20%20%20%2A%20%2A%20%60error_log%60%20Output%20to%20error%20log%20as%20configured%20in%20php.ini%0D%0A%20%20%20%20%20%2A%0D%0A%20%20%20%20%20%2A%20Alternatively%2C%20you%20can%20provide%20a%20callable%20expecting%20two%20params%3A%20a%20message%20string%20and%20the%20debug%20level%3A%0D%0A%20%20%20%20%20%2A%20%3Ccode%3E%0D%0A%20%20%20%20%20%2A%20%24mail-%3EDebugoutput%20%3D%20function%28%24str%2C%20%24level%29%20%7Becho%20%22debug%20level%20%24level%3B%20message%3A%20%24str%22%3B%7D%3B%0D%0A%20%20%20%20%20%2A%20%3C%2Fcode%3E%0D%0A%20%20%20%20%20%2A%20%40var%20string%7Ccallable%0D%0A%20%20%20%20%20%2A%20%40see%20SMTP%3A%3A%24Debugoutput%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24Debugoutput%20%3D%20%27echo%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Whether%20to%20keep%20SMTP%20connection%20open%20after%20each%20message.%0D%0A%20%20%20%20%20%2A%20If%20this%20is%20set%20to%20true%20then%20to%20close%20the%20connection%0D%0A%20%20%20%20%20%2A%20requires%20an%20explicit%20call%20to%20smtpClose%28%29.%0D%0A%20%20%20%20%20%2A%20%40var%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24SMTPKeepAlive%20%3D%20false%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Whether%20to%20split%20multiple%20to%20addresses%20into%20multiple%20messages%0D%0A%20%20%20%20%20%2A%20or%20send%20them%20all%20in%20one%20message.%0D%0A%20%20%20%20%20%2A%20Only%20supported%20in%20%60mail%60%20and%20%60sendmail%60%20transports%2C%20not%20in%20SMTP.%0D%0A%20%20%20%20%20%2A%20%40var%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24SingleTo%20%3D%20false%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Storage%20for%20addresses%20when%20SingleTo%20is%20enabled.%0D%0A%20%20%20%20%20%2A%20%40var%20array%0D%0A%20%20%20%20%20%2A%20%40TODO%20This%20should%20really%20not%20be%20public%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24SingleToArray%20%3D%20array%28%29%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Whether%20to%20generate%20VERP%20addresses%20on%20send.%0D%0A%20%20%20%20%20%2A%20Only%20applicable%20when%20sending%20via%20SMTP.%0D%0A%20%20%20%20%20%2A%20%40link%20https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FVariable_envelope_return_path%0D%0A%20%20%20%20%20%2A%20%40link%20http%3A%2F%2Fwww.postfix.org%2FVERP_README.html%20Postfix%20VERP%20info%0D%0A%20%20%20%20%20%2A%20%40var%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24do_verp%20%3D%20false%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Whether%20to%20allow%20sending%20messages%20with%20an%20empty%20body.%0D%0A%20%20%20%20%20%2A%20%40var%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24AllowEmpty%20%3D%20false%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20default%20line%20ending.%0D%0A%20%20%20%20%20%2A%20%40note%20The%20default%20remains%20%22%5Cn%22.%20We%20force%20CRLF%20where%20we%20know%0D%0A%20%20%20%20%20%2A%20%20%20%20%20%20%20%20it%20must%20be%20used%20via%20self%3A%3ACRLF.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24LE%20%3D%20%22%5Cn%22%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20DKIM%20selector.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24DKIM_selector%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20DKIM%20Identity.%0D%0A%20%20%20%20%20%2A%20Usually%20the%20email%20address%20used%20as%20the%20source%20of%20the%20email.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24DKIM_identity%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20DKIM%20passphrase.%0D%0A%20%20%20%20%20%2A%20Used%20if%20your%20key%20is%20encrypted.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24DKIM_passphrase%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20DKIM%20signing%20domain%20name.%0D%0A%20%20%20%20%20%2A%20%40example%20%27example.com%27%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24DKIM_domain%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20DKIM%20private%20key%20file%20path.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24DKIM_private%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20DKIM%20private%20key%20string.%0D%0A%20%20%20%20%20%2A%20If%20set%2C%20takes%20precedence%20over%20%60%24DKIM_private%60.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24DKIM_private_string%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Callback%20Action%20function%20name.%0D%0A%20%20%20%20%20%2A%0D%0A%20%20%20%20%20%2A%20The%20function%20that%20handles%20the%20result%20of%20the%20send%20email%20action.%0D%0A%20%20%20%20%20%2A%20It%20is%20called%20out%20by%20send%28%29%20for%20each%20email%20sent.%0D%0A%20%20%20%20%20%2A%0D%0A%20%20%20%20%20%2A%20Value%20can%20be%20any%20php%20callable%3A%20http%3A%2F%2Fwww.php.net%2Fis_callable%0D%0A%20%20%20%20%20%2A%0D%0A%20%20%20%20%20%2A%20Parameters%3A%0D%0A%20%20%20%20%20%2A%20%20%20boolean%20%24result%20%20%20%20%20%20%20%20result%20of%20the%20send%20action%0D%0A%20%20%20%20%20%2A%20%20%20array%20%20%20%24to%20%20%20%20%20%20%20%20%20%20%20%20email%20addresses%20of%20the%20recipients%0D%0A%20%20%20%20%20%2A%20%20%20array%20%20%20%24cc%20%20%20%20%20%20%20%20%20%20%20%20cc%20email%20addresses%0D%0A%20%20%20%20%20%2A%20%20%20array%20%20%20%24bcc%20%20%20%20%20%20%20%20%20%20%20bcc%20email%20addresses%0D%0A%20%20%20%20%20%2A%20%20%20string%20%20%24subject%20%20%20%20%20%20%20the%20subject%0D%0A%20%20%20%20%20%2A%20%20%20string%20%20%24body%20%20%20%20%20%20%20%20%20%20the%20email%20body%0D%0A%20%20%20%20%20%2A%20%20%20string%20%20%24from%20%20%20%20%20%20%20%20%20%20email%20address%20of%20sender%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24action_function%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20What%20to%20put%20in%20the%20X-Mailer%20header.%0D%0A%20%20%20%20%20%2A%20Options%3A%20An%20empty%20string%20for%20PHPMailer%20default%2C%20whitespace%20for%20none%2C%20or%20a%20string%20to%20use%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20%24XMailer%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Which%20validator%20to%20use%20by%20default%20when%20validating%20email%20addresses.%0D%0A%20%20%20%20%20%2A%20May%20be%20a%20callable%20to%20inject%20your%20own%20validator%2C%20but%20there%20are%20several%20built-in%20validators.%0D%0A%20%20%20%20%20%2A%20%40see%20PHPMailer%3A%3AvalidateAddress%28%29%0D%0A%20%20%20%20%20%2A%20%40var%20string%7Ccallable%0D%0A%20%20%20%20%20%2A%20%40static%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20static%20%24validator%20%3D%20%27auto%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20An%20instance%20of%20the%20SMTP%20sender%20class.%0D%0A%20%20%20%20%20%2A%20%40var%20SMTP%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24smtp%20%3D%20null%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20array%20of%20%27to%27%20names%20and%20addresses.%0D%0A%20%20%20%20%20%2A%20%40var%20array%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24to%20%3D%20array%28%29%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20array%20of%20%27cc%27%20names%20and%20addresses.%0D%0A%20%20%20%20%20%2A%20%40var%20array%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24cc%20%3D%20array%28%29%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20array%20of%20%27bcc%27%20names%20and%20addresses.%0D%0A%20%20%20%20%20%2A%20%40var%20array%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24bcc%20%3D%20array%28%29%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20array%20of%20reply-to%20names%20and%20addresses.%0D%0A%20%20%20%20%20%2A%20%40var%20array%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24ReplyTo%20%3D%20array%28%29%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20An%20array%20of%20all%20kinds%20of%20addresses.%0D%0A%20%20%20%20%20%2A%20Includes%20all%20of%20%24to%2C%20%24cc%2C%20%24bcc%0D%0A%20%20%20%20%20%2A%20%40var%20array%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40see%20PHPMailer%3A%3A%24to%20%40see%20PHPMailer%3A%3A%24cc%20%40see%20PHPMailer%3A%3A%24bcc%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24all_recipients%20%3D%20array%28%29%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20An%20array%20of%20names%20and%20addresses%20queued%20for%20validation.%0D%0A%20%20%20%20%20%2A%20In%20send%28%29%2C%20valid%20and%20non%20duplicate%20entries%20are%20moved%20to%20%24all_recipients%0D%0A%20%20%20%20%20%2A%20and%20one%20of%20%24to%2C%20%24cc%2C%20or%20%24bcc.%0D%0A%20%20%20%20%20%2A%20This%20array%20is%20used%20only%20for%20addresses%20with%20IDN.%0D%0A%20%20%20%20%20%2A%20%40var%20array%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40see%20PHPMailer%3A%3A%24to%20%40see%20PHPMailer%3A%3A%24cc%20%40see%20PHPMailer%3A%3A%24bcc%0D%0A%20%20%20%20%20%2A%20%40see%20PHPMailer%3A%3A%24all_recipients%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24RecipientsQueue%20%3D%20array%28%29%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20An%20array%20of%20reply-to%20names%20and%20addresses%20queued%20for%20validation.%0D%0A%20%20%20%20%20%2A%20In%20send%28%29%2C%20valid%20and%20non%20duplicate%20entries%20are%20moved%20to%20%24ReplyTo.%0D%0A%20%20%20%20%20%2A%20This%20array%20is%20used%20only%20for%20addresses%20with%20IDN.%0D%0A%20%20%20%20%20%2A%20%40var%20array%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40see%20PHPMailer%3A%3A%24ReplyTo%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24ReplyToQueue%20%3D%20array%28%29%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20array%20of%20attachments.%0D%0A%20%20%20%20%20%2A%20%40var%20array%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24attachment%20%3D%20array%28%29%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20array%20of%20custom%20headers.%0D%0A%20%20%20%20%20%2A%20%40var%20array%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24CustomHeader%20%3D%20array%28%29%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20most%20recent%20Message-ID%20%28including%20angular%20brackets%29.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24lastMessageID%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20message%27s%20MIME%20type.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24message_type%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20array%20of%20MIME%20boundary%20strings.%0D%0A%20%20%20%20%20%2A%20%40var%20array%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24boundary%20%3D%20array%28%29%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20array%20of%20available%20languages.%0D%0A%20%20%20%20%20%2A%20%40var%20array%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24language%20%3D%20array%28%29%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20number%20of%20errors%20encountered.%0D%0A%20%20%20%20%20%2A%20%40var%20integer%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24error_count%20%3D%200%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20S%2FMIME%20certificate%20file%20path.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24sign_cert_file%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20S%2FMIME%20key%20file%20path.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24sign_key_file%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20optional%20S%2FMIME%20extra%20certificates%20%28%22CA%20Chain%22%29%20file%20path.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24sign_extracerts_file%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20S%2FMIME%20password%20for%20the%20key.%0D%0A%20%20%20%20%20%2A%20Used%20only%20if%20the%20key%20is%20encrypted.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24sign_key_pass%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Whether%20to%20throw%20exceptions%20for%20errors.%0D%0A%20%20%20%20%20%2A%20%40var%20boolean%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24exceptions%20%3D%20false%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Unique%20ID%20used%20for%20message%20ID%20and%20boundaries.%0D%0A%20%20%20%20%20%2A%20%40var%20string%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20%24uniqueid%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Error%20severity%3A%20message%20only%2C%20continue%20processing.%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20const%20STOP_MESSAGE%20%3D%200%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Error%20severity%3A%20message%2C%20likely%20ok%20to%20continue%20processing.%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20const%20STOP_CONTINUE%20%3D%201%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Error%20severity%3A%20message%2C%20plus%20full%20stop%2C%20critical%20error%20reached.%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20const%20STOP_CRITICAL%20%3D%202%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20SMTP%20RFC%20standard%20line%20ending.%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20const%20CRLF%20%3D%20%22%5Cr%5Cn%22%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20The%20maximum%20line%20length%20allowed%20by%20RFC%202822%20section%202.1.1%0D%0A%20%20%20%20%20%2A%20%40var%20integer%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20const%20MAX_LINE_LENGTH%20%3D%20998%3B%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Constructor.%0D%0A%20%20%20%20%20%2A%20%40param%20boolean%20%24exceptions%20Should%20we%20throw%20external%20exceptions%3F%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20__construct%28%24exceptions%20%3D%20null%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24exceptions%20%21%3D%3D%20null%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eexceptions%20%3D%20%28boolean%29%24exceptions%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2FPick%20an%20appropriate%20debug%20output%20format%20automatically%0D%0A%20%20%20%20%20%20%20%20%24this-%3EDebugoutput%20%3D%20%28strpos%28PHP_SAPI%2C%20%27cli%27%29%20%21%3D%3D%20false%20%3F%20%27echo%27%20%3A%20%27html%27%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Destructor.%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20__destruct%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2FClose%20any%20open%20SMTP%20connection%20nicely%0D%0A%20%20%20%20%20%20%20%20%24this-%3EsmtpClose%28%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Call%20mail%28%29%20in%20a%20safe_mode-aware%20fashion.%0D%0A%20%20%20%20%20%2A%20Also%2C%20unless%20sendmail_path%20points%20to%20sendmail%20%28or%20something%20that%0D%0A%20%20%20%20%20%2A%20claims%20to%20be%20sendmail%29%2C%20don%27t%20pass%20params%20%28not%20a%20perfect%20fix%2C%0D%0A%20%20%20%20%20%2A%20but%20it%20will%20do%29%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24to%20To%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24subject%20Subject%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24body%20Message%20Body%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24header%20Additional%20Header%28s%29%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24params%20Params%0D%0A%20%20%20%20%20%2A%20%40access%20private%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20private%20function%20mailPassthru%28%24to%2C%20%24subject%2C%20%24body%2C%20%24header%2C%20%24params%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2FCheck%20overloading%20of%20mail%20function%20to%20avoid%20double-encoding%0D%0A%20%20%20%20%20%20%20%20if%20%28ini_get%28%27mbstring.func_overload%27%29%20%26%201%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24subject%20%3D%20%24this-%3EsecureHeader%28%24subject%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24subject%20%3D%20%24this-%3EencodeHeader%28%24this-%3EsecureHeader%28%24subject%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2FCan%27t%20use%20additional_parameters%20in%20safe_mode%2C%20calling%20mail%28%29%20with%20null%20params%20breaks%0D%0A%20%20%20%20%20%20%20%20%2F%2F%40link%20http%3A%2F%2Fphp.net%2Fmanual%2Fen%2Ffunction.mail.php%0D%0A%20%20%20%20%20%20%20%20if%20%28ini_get%28%27safe_mode%27%29%20or%20%21%24this-%3EUseSendmailOptions%20or%20is_null%28%24params%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20%3D%20%40mail%28%24to%2C%20%24subject%2C%20%24body%2C%20%24header%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20%3D%20%40mail%28%24to%2C%20%24subject%2C%20%24body%2C%20%24header%2C%20%24params%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%24result%3B%0D%0A%20%20%20%20%7D%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Output%20debugging%20info%20via%20user-defined%20method.%0D%0A%20%20%20%20%20%2A%20Only%20generates%20output%20if%20SMTP%20debug%20output%20is%20enabled%20%28%40see%20SMTP%3A%3A%24do_debug%29.%0D%0A%20%20%20%20%20%2A%20%40see%20PHPMailer%3A%3A%24Debugoutput%0D%0A%20%20%20%20%20%2A%20%40see%20PHPMailer%3A%3A%24SMTPDebug%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24str%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20edebug%28%24str%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3ESMTPDebug%20%3C%3D%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2FAvoid%20clash%20with%20built-in%20function%20names%0D%0A%20%20%20%20%20%20%20%20if%20%28%21in_array%28%24this-%3EDebugoutput%2C%20array%28%27error_log%27%2C%20%27html%27%2C%20%27echo%27%29%29%20and%20is_callable%28%24this-%3EDebugoutput%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20call_user_func%28%24this-%3EDebugoutput%2C%20%24str%2C%20%24this-%3ESMTPDebug%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20switch%20%28%24this-%3EDebugoutput%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27error_log%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FDon%27t%20output%2C%20just%20log%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20error_log%28%24str%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27html%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FCleans%20up%20output%20a%20bit%20for%20a%20better%20looking%2C%20HTML-safe%20output%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20htmlentities%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20preg_replace%28%27%2F%5B%5Cr%5Cn%5D%2B%2F%27%2C%20%27%27%2C%20%24str%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ENT_QUOTES%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27UTF-8%27%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.%20%22%3Cbr%3E%5Cn%22%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27echo%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20default%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FNormalize%20line%20breaks%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24str%20%3D%20preg_replace%28%27%2F%5Cr%5Cn%3F%2Fms%27%2C%20%22%5Cn%22%2C%20%24str%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20echo%20gmdate%28%27Y-m-d%20H%3Ai%3As%27%29%20.%20%22%5Ct%22%20.%20str_replace%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%5Cn%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%5Cn%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Ct%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20trim%28%24str%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%20.%20%22%5Cn%22%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Sets%20message%20type%20to%20HTML%20or%20plain.%0D%0A%20%20%20%20%20%2A%20%40param%20boolean%20%24isHtml%20True%20for%20HTML%20mode.%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20isHTML%28%24isHtml%20%3D%20true%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24isHtml%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EContentType%20%3D%20%27text%2Fhtml%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EContentType%20%3D%20%27text%2Fplain%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20messages%20using%20SMTP.%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20isSMTP%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3EMailer%20%3D%20%27smtp%27%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20messages%20using%20PHP%27s%20mail%28%29%20function.%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20isMail%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3EMailer%20%3D%20%27mail%27%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20messages%20using%20%24Sendmail.%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20isSendmail%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24ini_sendmail_path%20%3D%20ini_get%28%27sendmail_path%27%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20if%20%28%21stristr%28%24ini_sendmail_path%2C%20%27sendmail%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ESendmail%20%3D%20%27%2Fusr%2Fsbin%2Fsendmail%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ESendmail%20%3D%20%24ini_sendmail_path%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24this-%3EMailer%20%3D%20%27sendmail%27%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20messages%20using%20qmail.%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20isQmail%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24ini_sendmail_path%20%3D%20ini_get%28%27sendmail_path%27%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20if%20%28%21stristr%28%24ini_sendmail_path%2C%20%27qmail%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ESendmail%20%3D%20%27%2Fvar%2Fqmail%2Fbin%2Fqmail-inject%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ESendmail%20%3D%20%24ini_sendmail_path%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24this-%3EMailer%20%3D%20%27qmail%27%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Add%20a%20%22To%22%20address.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24address%20The%20email%20address%20to%20send%20to%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24name%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%20true%20on%20success%2C%20false%20if%20address%20already%20used%20or%20invalid%20in%20some%20way%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20addAddress%28%24address%2C%20%24name%20%3D%20%27%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3EaddOrEnqueueAnAddress%28%27to%27%2C%20%24address%2C%20%24name%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Add%20a%20%22CC%22%20address.%0D%0A%20%20%20%20%20%2A%20%40note%3A%20This%20function%20works%20with%20the%20SMTP%20mailer%20on%20win32%2C%20not%20with%20the%20%22mail%22%20mailer.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24address%20The%20email%20address%20to%20send%20to%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24name%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%20true%20on%20success%2C%20false%20if%20address%20already%20used%20or%20invalid%20in%20some%20way%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20addCC%28%24address%2C%20%24name%20%3D%20%27%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3EaddOrEnqueueAnAddress%28%27cc%27%2C%20%24address%2C%20%24name%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Add%20a%20%22BCC%22%20address.%0D%0A%20%20%20%20%20%2A%20%40note%3A%20This%20function%20works%20with%20the%20SMTP%20mailer%20on%20win32%2C%20not%20with%20the%20%22mail%22%20mailer.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24address%20The%20email%20address%20to%20send%20to%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24name%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%20true%20on%20success%2C%20false%20if%20address%20already%20used%20or%20invalid%20in%20some%20way%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20addBCC%28%24address%2C%20%24name%20%3D%20%27%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3EaddOrEnqueueAnAddress%28%27bcc%27%2C%20%24address%2C%20%24name%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Add%20a%20%22Reply-To%22%20address.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24address%20The%20email%20address%20to%20reply%20to%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24name%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%20true%20on%20success%2C%20false%20if%20address%20already%20used%20or%20invalid%20in%20some%20way%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20addReplyTo%28%24address%2C%20%24name%20%3D%20%27%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3EaddOrEnqueueAnAddress%28%27Reply-To%27%2C%20%24address%2C%20%24name%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Add%20an%20address%20to%20one%20of%20the%20recipient%20arrays%20or%20to%20the%20ReplyTo%20array.%20Because%20PHPMailer%0D%0A%20%20%20%20%20%2A%20can%27t%20validate%20addresses%20with%20an%20IDN%20without%20knowing%20the%20PHPMailer%3A%3A%24CharSet%20%28that%20can%20still%0D%0A%20%20%20%20%20%2A%20be%20modified%20after%20calling%20this%20function%29%2C%20addition%20of%20such%20addresses%20is%20delayed%20until%20send%28%29.%0D%0A%20%20%20%20%20%2A%20Addresses%20that%20have%20been%20added%20already%20return%20false%2C%20but%20do%20not%20throw%20exceptions.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24kind%20One%20of%20%27to%27%2C%20%27cc%27%2C%20%27bcc%27%2C%20or%20%27ReplyTo%27%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24address%20The%20email%20address%20to%20send%2C%20resp.%20to%20reply%20to%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24name%0D%0A%20%20%20%20%20%2A%20%40throws%20phpmailerException%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%20true%20on%20success%2C%20false%20if%20address%20already%20used%20or%20invalid%20in%20some%20way%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20addOrEnqueueAnAddress%28%24kind%2C%20%24address%2C%20%24name%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24address%20%3D%20trim%28%24address%29%3B%0D%0A%20%20%20%20%20%20%20%20%24name%20%3D%20trim%28preg_replace%28%27%2F%5B%5Cr%5Cn%5D%2B%2F%27%2C%20%27%27%2C%20%24name%29%29%3B%20%2F%2FStrip%20breaks%20and%20trim%0D%0A%20%20%20%20%20%20%20%20if%20%28%28%24pos%20%3D%20strrpos%28%24address%2C%20%27%40%27%29%29%20%3D%3D%3D%20false%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20At-sign%20is%20misssing.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24error_message%20%3D%20%24this-%3Elang%28%27invalid_address%27%29%20.%20%22%20%28addAnAddress%20%24kind%29%3A%20%24address%22%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%24error_message%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%24error_message%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3Eexceptions%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24error_message%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24params%20%3D%20array%28%24kind%2C%20%24address%2C%20%24name%29%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Enqueue%20addresses%20with%20IDN%20until%20we%20know%20the%20PHPMailer%3A%3A%24CharSet.%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3Ehas8bitChars%28substr%28%24address%2C%20%2B%2B%24pos%29%29%20and%20%24this-%3EidnSupported%28%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24kind%20%21%3D%20%27Reply-To%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21array_key_exists%28%24address%2C%20%24this-%3ERecipientsQueue%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ERecipientsQueue%5B%24address%5D%20%3D%20%24params%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21array_key_exists%28%24address%2C%20%24this-%3EReplyToQueue%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EReplyToQueue%5B%24address%5D%20%3D%20%24params%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Immediately%20add%20standard%20addresses%20without%20IDN.%0D%0A%20%20%20%20%20%20%20%20return%20call_user_func_array%28array%28%24this%2C%20%27addAnAddress%27%29%2C%20%24params%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Add%20an%20address%20to%20one%20of%20the%20recipient%20arrays%20or%20to%20the%20ReplyTo%20array.%0D%0A%20%20%20%20%20%2A%20Addresses%20that%20have%20been%20added%20already%20return%20false%2C%20but%20do%20not%20throw%20exceptions.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24kind%20One%20of%20%27to%27%2C%20%27cc%27%2C%20%27bcc%27%2C%20or%20%27ReplyTo%27%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24address%20The%20email%20address%20to%20send%2C%20resp.%20to%20reply%20to%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24name%0D%0A%20%20%20%20%20%2A%20%40throws%20phpmailerException%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%20true%20on%20success%2C%20false%20if%20address%20already%20used%20or%20invalid%20in%20some%20way%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20addAnAddress%28%24kind%2C%20%24address%2C%20%24name%20%3D%20%27%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%21in_array%28%24kind%2C%20array%28%27to%27%2C%20%27cc%27%2C%20%27bcc%27%2C%20%27Reply-To%27%29%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24error_message%20%3D%20%24this-%3Elang%28%27Invalid%20recipient%20kind%3A%20%27%29%20.%20%24kind%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%24error_message%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%24error_message%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3Eexceptions%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24error_message%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28%21%24this-%3EvalidateAddress%28%24address%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24error_message%20%3D%20%24this-%3Elang%28%27invalid_address%27%29%20.%20%22%20%28addAnAddress%20%24kind%29%3A%20%24address%22%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%24error_message%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%24error_message%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3Eexceptions%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24error_message%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28%24kind%20%21%3D%20%27Reply-To%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21array_key_exists%28strtolower%28%24address%29%2C%20%24this-%3Eall_recipients%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20array_push%28%24this-%3E%24kind%2C%20array%28%24address%2C%20%24name%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eall_recipients%5Bstrtolower%28%24address%29%5D%20%3D%20true%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21array_key_exists%28strtolower%28%24address%29%2C%20%24this-%3EReplyTo%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EReplyTo%5Bstrtolower%28%24address%29%5D%20%3D%20array%28%24address%2C%20%24name%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Parse%20and%20validate%20a%20string%20containing%20one%20or%20more%20RFC822-style%20comma-separated%20email%20addresses%0D%0A%20%20%20%20%20%2A%20of%20the%20form%20%22display%20name%20%3Caddress%3E%22%20into%20an%20array%20of%20name%2Faddress%20pairs.%0D%0A%20%20%20%20%20%2A%20Uses%20the%20imap_rfc822_parse_adrlist%20function%20if%20the%20IMAP%20extension%20is%20available.%0D%0A%20%20%20%20%20%2A%20Note%20that%20quotes%20in%20the%20name%20part%20are%20removed.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24addrstr%20The%20address%20list%20string%0D%0A%20%20%20%20%20%2A%20%40param%20bool%20%24useimap%20Whether%20to%20use%20the%20IMAP%20extension%20to%20parse%20the%20list%0D%0A%20%20%20%20%20%2A%20%40return%20array%0D%0A%20%20%20%20%20%2A%20%40link%20http%3A%2F%2Fwww.andrew.cmu.edu%2Fuser%2Fagreen1%2Ftesting%2Fmrbs%2Fweb%2FMail%2FRFC822.php%20A%20more%20careful%20implementation%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20parseAddresses%28%24addrstr%2C%20%24useimap%20%3D%20true%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24addresses%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24useimap%20and%20function_exists%28%27imap_rfc822_parse_adrlist%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FUse%20this%20built-in%20parser%20if%20it%27s%20available%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24list%20%3D%20imap_rfc822_parse_adrlist%28%24addrstr%2C%20%27%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20foreach%20%28%24list%20as%20%24address%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24address-%3Ehost%20%21%3D%20%27.SYNTAX-ERROR.%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3EvalidateAddress%28%24address-%3Emailbox%20.%20%27%40%27%20.%20%24address-%3Ehost%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24addresses%5B%5D%20%3D%20array%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27name%27%20%3D%3E%20%28property_exists%28%24address%2C%20%27personal%27%29%20%3F%20%24address-%3Epersonal%20%3A%20%27%27%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27address%27%20%3D%3E%20%24address-%3Emailbox%20.%20%27%40%27%20.%20%24address-%3Ehost%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FUse%20this%20simpler%20parser%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24list%20%3D%20explode%28%27%2C%27%2C%20%24addrstr%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20foreach%20%28%24list%20as%20%24address%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24address%20%3D%20trim%28%24address%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FIs%20there%20a%20separate%20name%20part%3F%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28strpos%28%24address%2C%20%27%3C%27%29%20%3D%3D%3D%20false%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FNo%20separate%20name%2C%20just%20use%20the%20whole%20thing%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3EvalidateAddress%28%24address%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24addresses%5B%5D%20%3D%20array%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27name%27%20%3D%3E%20%27%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27address%27%20%3D%3E%20%24address%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20list%28%24name%2C%20%24email%29%20%3D%20explode%28%27%3C%27%2C%20%24address%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24email%20%3D%20trim%28str_replace%28%27%3E%27%2C%20%27%27%2C%20%24email%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3EvalidateAddress%28%24email%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24addresses%5B%5D%20%3D%20array%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27name%27%20%3D%3E%20trim%28str_replace%28array%28%27%22%27%2C%20%22%27%22%29%2C%20%27%27%2C%20%24name%29%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27address%27%20%3D%3E%20%24email%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%24addresses%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Set%20the%20From%20and%20FromName%20properties.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24address%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24name%0D%0A%20%20%20%20%20%2A%20%40param%20boolean%20%24auto%20Whether%20to%20also%20set%20the%20Sender%20address%2C%20defaults%20to%20true%0D%0A%20%20%20%20%20%2A%20%40throws%20phpmailerException%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20setFrom%28%24address%2C%20%24name%20%3D%20%27%27%2C%20%24auto%20%3D%20true%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24address%20%3D%20trim%28%24address%29%3B%0D%0A%20%20%20%20%20%20%20%20%24name%20%3D%20trim%28preg_replace%28%27%2F%5B%5Cr%5Cn%5D%2B%2F%27%2C%20%27%27%2C%20%24name%29%29%3B%20%2F%2FStrip%20breaks%20and%20trim%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Don%27t%20validate%20now%20addresses%20with%20IDN.%20Will%20be%20done%20in%20send%28%29.%0D%0A%20%20%20%20%20%20%20%20if%20%28%28%24pos%20%3D%20strrpos%28%24address%2C%20%27%40%27%29%29%20%3D%3D%3D%20false%20or%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%28%21%24this-%3Ehas8bitChars%28substr%28%24address%2C%20%2B%2B%24pos%29%29%20or%20%21%24this-%3EidnSupported%28%29%29%20and%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%21%24this-%3EvalidateAddress%28%24address%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24error_message%20%3D%20%24this-%3Elang%28%27invalid_address%27%29%20.%20%22%20%28setFrom%29%20%24address%22%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%24error_message%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%24error_message%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3Eexceptions%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24error_message%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24this-%3EFrom%20%3D%20%24address%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3EFromName%20%3D%20%24name%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24auto%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28empty%28%24this-%3ESender%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ESender%20%3D%20%24address%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Return%20the%20Message-ID%20header%20of%20the%20last%20email.%0D%0A%20%20%20%20%20%2A%20Technically%20this%20is%20the%20value%20from%20the%20last%20time%20the%20headers%20were%20created%2C%0D%0A%20%20%20%20%20%2A%20but%20it%27s%20also%20the%20message%20ID%20of%20the%20last%20sent%20message%20except%20in%0D%0A%20%20%20%20%20%2A%20pathological%20cases.%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getLastMessageID%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3ElastMessageID%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Check%20that%20a%20string%20looks%20like%20an%20email%20address.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24address%20The%20email%20address%20to%20check%0D%0A%20%20%20%20%20%2A%20%40param%20string%7Ccallable%20%24patternselect%20A%20selector%20for%20the%20validation%20pattern%20to%20use%20%3A%0D%0A%20%20%20%20%20%2A%20%2A%20%60auto%60%20Pick%20best%20pattern%20automatically%3B%0D%0A%20%20%20%20%20%2A%20%2A%20%60pcre8%60%20Use%20the%20squiloople.com%20pattern%2C%20requires%20PCRE%20%3E%208.0%2C%20PHP%20%3E%3D%205.3.2%2C%205.2.14%3B%0D%0A%20%20%20%20%20%2A%20%2A%20%60pcre%60%20Use%20old%20PCRE%20implementation%3B%0D%0A%20%20%20%20%20%2A%20%2A%20%60php%60%20Use%20PHP%20built-in%20FILTER_VALIDATE_EMAIL%3B%0D%0A%20%20%20%20%20%2A%20%2A%20%60html5%60%20Use%20the%20pattern%20given%20by%20the%20HTML5%20spec%20for%20%27email%27%20type%20form%20input%20elements.%0D%0A%20%20%20%20%20%2A%20%2A%20%60noregex%60%20Don%27t%20use%20a%20regex%3A%20super%20fast%2C%20really%20dumb.%0D%0A%20%20%20%20%20%2A%20Alternatively%20you%20may%20pass%20in%20a%20callable%20to%20inject%20your%20own%20validator%2C%20for%20example%3A%0D%0A%20%20%20%20%20%2A%20PHPMailer%3A%3AvalidateAddress%28%27user%40example.com%27%2C%20function%28%24address%29%20%7B%0D%0A%20%20%20%20%20%2A%20%20%20%20%20return%20%28strpos%28%24address%2C%20%27%40%27%29%20%21%3D%3D%20false%29%3B%0D%0A%20%20%20%20%20%2A%20%7D%29%3B%0D%0A%20%20%20%20%20%2A%20You%20can%20also%20set%20the%20PHPMailer%3A%3A%24validator%20static%20to%20a%20callable%2C%20allowing%20built-in%20methods%20to%20use%20your%20validator.%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%20%40static%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20static%20function%20validateAddress%28%24address%2C%20%24patternselect%20%3D%20null%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28is_null%28%24patternselect%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24patternselect%20%3D%20self%3A%3A%24validator%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28is_callable%28%24patternselect%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20call_user_func%28%24patternselect%2C%20%24address%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2FReject%20line%20breaks%20in%20addresses%3B%20it%27s%20valid%20RFC5322%2C%20but%20not%20RFC5321%0D%0A%20%20%20%20%20%20%20%20if%20%28strpos%28%24address%2C%20%22%5Cn%22%29%20%21%3D%3D%20false%20or%20strpos%28%24address%2C%20%22%5Cr%22%29%20%21%3D%3D%20false%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28%21%24patternselect%20or%20%24patternselect%20%3D%3D%20%27auto%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FCheck%20this%20constant%20first%20so%20it%20works%20when%20extension_loaded%28%29%20is%20disabled%20by%20safe%20mode%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FConstant%20was%20added%20in%20PHP%205.2.4%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28defined%28%27PCRE_VERSION%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FThis%20pattern%20can%20get%20stuck%20in%20a%20recursive%20loop%20in%20PCRE%20%3C%3D%208.0.2%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28version_compare%28PCRE_VERSION%2C%20%278.0.3%27%29%20%3E%3D%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24patternselect%20%3D%20%27pcre8%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24patternselect%20%3D%20%27pcre%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20elseif%20%28function_exists%28%27extension_loaded%27%29%20and%20extension_loaded%28%27pcre%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FFall%20back%20to%20older%20PCRE%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24patternselect%20%3D%20%27pcre%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FFilter_var%20appeared%20in%20PHP%205.2.0%20and%20does%20not%20require%20the%20PCRE%20extension%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28version_compare%28PHP_VERSION%2C%20%275.2.0%27%29%20%3E%3D%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24patternselect%20%3D%20%27php%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24patternselect%20%3D%20%27noregex%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20switch%20%28%24patternselect%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27pcre8%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2A%20Uses%20the%20same%20RFC5322%20regex%20on%20which%20FILTER_VALIDATE_EMAIL%20is%20based%2C%20but%20allows%20dotless%20domains.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2A%20%40link%20http%3A%2F%2Fsquiloople.com%2F2009%2F12%2F20%2Femail-address-validation%2F%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2A%20%40copyright%202009-2010%20Michael%20Rushton%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2A%20Feel%20free%20to%20use%20and%20redistribute%20this%20code.%20But%20please%20keep%20this%20copyright%20notice.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%28boolean%29preg_match%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%2F%5E%28%3F%21%28%3F%3E%28%3F1%29%22%3F%28%3F%3E%5C%5C%5C%5B%20-~%5D%7C%5B%5E%22%5D%29%22%3F%28%3F1%29%29%7B255%2C%7D%29%28%3F%21%28%3F%3E%28%3F1%29%22%3F%28%3F%3E%5C%5C%5C%5B%20-~%5D%7C%5B%5E%22%5D%29%22%3F%28%3F1%29%29%7B65%2C%7D%40%29%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%28%28%3F%3E%28%3F%3E%28%3F%3E%28%28%3F%3E%28%3F%3E%28%3F%3E%5Cx0D%5Cx0A%29%3F%5B%5Ct%20%5D%29%2B%7C%28%3F%3E%5B%5Ct%20%5D%2A%5Cx0D%5Cx0A%29%3F%5B%5Ct%20%5D%2B%29%3F%29%28%5C%28%28%3F%3E%28%3F2%29%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%28%3F%3E%5B%5Cx01-%5Cx08%5Cx0B%5Cx0C%5Cx0E-%5C%27%2A-%5C%5B%5C%5D-%5Cx7F%5D%7C%5C%5C%5C%5B%5Cx00-%5Cx7F%5D%7C%28%3F3%29%29%29%2A%28%3F2%29%5C%29%29%29%2B%28%3F2%29%29%7C%28%3F2%29%29%3F%29%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%28%5B%21%23-%5C%27%2A%2B%5C%2F-9%3D%3F%5E-~-%5D%2B%7C%22%28%3F%3E%28%3F2%29%28%3F%3E%5B%5Cx01-%5Cx08%5Cx0B%5Cx0C%5Cx0E-%21%23-%5C%5B%5C%5D-%5Cx7F%5D%7C%5C%5C%5C%5B%5Cx00-%5Cx7F%5D%29%29%2A%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%28%3F2%29%22%29%28%3F%3E%28%3F1%29%5C.%28%3F1%29%28%3F4%29%29%2A%28%3F1%29%40%28%3F%21%28%3F1%29%5Ba-z0-9-%5D%7B64%2C%7D%29%28%3F1%29%28%3F%3E%28%5Ba-z0-9%5D%28%3F%3E%5Ba-z0-9-%5D%2A%5Ba-z0-9%5D%29%3F%29%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%28%3F%3E%28%3F1%29%5C.%28%3F%21%28%3F1%29%5Ba-z0-9-%5D%7B64%2C%7D%29%28%3F1%29%28%3F5%29%29%7B0%2C126%7D%7C%5C%5B%28%3F%3A%28%3F%3EIPv6%3A%28%3F%3E%28%5Ba-f0-9%5D%7B1%2C4%7D%29%28%3F%3E%3A%28%3F6%29%29%7B7%7D%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%7C%28%3F%21%28%3F%3A.%2A%5Ba-f0-9%5D%5B%3A%5C%5D%5D%29%7B8%2C%7D%29%28%28%3F6%29%28%3F%3E%3A%28%3F6%29%29%7B0%2C6%7D%29%3F%3A%3A%28%3F7%29%3F%29%29%7C%28%3F%3E%28%3F%3EIPv6%3A%28%3F%3E%28%3F6%29%28%3F%3E%3A%28%3F6%29%29%7B5%7D%3A%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%7C%28%3F%21%28%3F%3A.%2A%5Ba-f0-9%5D%3A%29%7B6%2C%7D%29%28%3F8%29%3F%3A%3A%28%3F%3E%28%28%3F6%29%28%3F%3E%3A%28%3F6%29%29%7B0%2C4%7D%29%3A%29%3F%29%29%3F%2825%5B0-5%5D%7C2%5B0-4%5D%5B0-9%5D%7C1%5B0-9%5D%7B2%7D%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%7C%5B1-9%5D%3F%5B0-9%5D%29%28%3F%3E%5C.%28%3F9%29%29%7B3%7D%29%29%5C%5D%29%28%3F1%29%24%2FisD%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24address%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27pcre%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FAn%20older%20regex%20that%20doesn%27t%20need%20a%20recent%20PCRE%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%28boolean%29preg_match%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%2F%5E%28%3F%21%28%3F%3E%22%3F%28%3F%3E%5C%5C%5C%5B%20-~%5D%7C%5B%5E%22%5D%29%22%3F%29%7B255%2C%7D%29%28%3F%21%28%3F%3E%22%3F%28%3F%3E%5C%5C%5C%5B%20-~%5D%7C%5B%5E%22%5D%29%22%3F%29%7B65%2C%7D%40%29%28%3F%3E%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%5B%21%23-%5C%27%2A%2B%5C%2F-9%3D%3F%5E-~-%5D%2B%7C%22%28%3F%3E%28%3F%3E%5B%5Cx01-%5Cx08%5Cx0B%5Cx0C%5Cx0E-%21%23-%5C%5B%5C%5D-%5Cx7F%5D%7C%5C%5C%5C%5B%5Cx00-%5CxFF%5D%29%29%2A%22%29%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%28%3F%3E%5C.%28%3F%3E%5B%21%23-%5C%27%2A%2B%5C%2F-9%3D%3F%5E-~-%5D%2B%7C%22%28%3F%3E%28%3F%3E%5B%5Cx01-%5Cx08%5Cx0B%5Cx0C%5Cx0E-%21%23-%5C%5B%5C%5D-%5Cx7F%5D%7C%5C%5C%5C%5B%5Cx00-%5CxFF%5D%29%29%2A%22%29%29%2A%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%40%28%3F%3E%28%3F%21%5Ba-z0-9-%5D%7B64%2C%7D%29%28%3F%3E%5Ba-z0-9%5D%28%3F%3E%5Ba-z0-9-%5D%2A%5Ba-z0-9%5D%29%3F%29%28%3F%3E%5C.%28%3F%21%5Ba-z0-9-%5D%7B64%2C%7D%29%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%28%3F%3E%5Ba-z0-9%5D%28%3F%3E%5Ba-z0-9-%5D%2A%5Ba-z0-9%5D%29%3F%29%29%7B0%2C126%7D%7C%5C%5B%28%3F%3A%28%3F%3EIPv6%3A%28%3F%3E%28%3F%3E%5Ba-f0-9%5D%7B1%2C4%7D%29%28%3F%3E%3A%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%5Ba-f0-9%5D%7B1%2C4%7D%29%7B7%7D%7C%28%3F%21%28%3F%3A.%2A%5Ba-f0-9%5D%5B%3A%5C%5D%5D%29%7B8%2C%7D%29%28%3F%3E%5Ba-f0-9%5D%7B1%2C4%7D%28%3F%3E%3A%5Ba-f0-9%5D%7B1%2C4%7D%29%7B0%2C6%7D%29%3F%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%3A%3A%28%3F%3E%5Ba-f0-9%5D%7B1%2C4%7D%28%3F%3E%3A%5Ba-f0-9%5D%7B1%2C4%7D%29%7B0%2C6%7D%29%3F%29%29%7C%28%3F%3E%28%3F%3EIPv6%3A%28%3F%3E%5Ba-f0-9%5D%7B1%2C4%7D%28%3F%3E%3A%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%5Ba-f0-9%5D%7B1%2C4%7D%29%7B5%7D%3A%7C%28%3F%21%28%3F%3A.%2A%5Ba-f0-9%5D%3A%29%7B6%2C%7D%29%28%3F%3E%5Ba-f0-9%5D%7B1%2C4%7D%28%3F%3E%3A%5Ba-f0-9%5D%7B1%2C4%7D%29%7B0%2C4%7D%29%3F%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%3A%3A%28%3F%3E%28%3F%3A%5Ba-f0-9%5D%7B1%2C4%7D%28%3F%3E%3A%5Ba-f0-9%5D%7B1%2C4%7D%29%7B0%2C4%7D%29%3A%29%3F%29%29%3F%28%3F%3E25%5B0-5%5D%7C2%5B0-4%5D%5B0-9%5D%7C1%5B0-9%5D%7B2%7D%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%7C%5B1-9%5D%3F%5B0-9%5D%29%28%3F%3E%5C.%28%3F%3E25%5B0-5%5D%7C2%5B0-4%5D%5B0-9%5D%7C1%5B0-9%5D%7B2%7D%7C%5B1-9%5D%3F%5B0-9%5D%29%29%7B3%7D%29%29%5C%5D%29%24%2FisD%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24address%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27html5%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2A%20This%20is%20the%20pattern%20used%20in%20the%20HTML5%20spec%20for%20validation%20of%20%27email%27%20type%20form%20input%20elements.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2A%20%40link%20http%3A%2F%2Fwww.whatwg.org%2Fspecs%2Fweb-apps%2Fcurrent-work%2F%23e-mail-state-%28type%3Demail%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%28boolean%29preg_match%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%2F%5E%5Ba-zA-Z0-9.%21%23%24%25%26%5C%27%2A%2B%5C%2F%3D%3F%5E_%60%7B%7C%7D~-%5D%2B%40%5Ba-zA-Z0-9%5D%28%3F%3A%5Ba-zA-Z0-9-%5D%7B0%2C61%7D%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%5Ba-zA-Z0-9%5D%29%3F%28%3F%3A%5C.%5Ba-zA-Z0-9%5D%28%3F%3A%5Ba-zA-Z0-9-%5D%7B0%2C61%7D%5Ba-zA-Z0-9%5D%29%3F%29%2A%24%2FsD%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24address%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27noregex%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FNo%20PCRE%21%20Do%20something%20_very_%20approximate%21%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FCheck%20the%20address%20is%203%20chars%20or%20longer%20and%20contains%20an%20%40%20that%27s%20not%20the%20first%20or%20last%20char%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%28strlen%28%24address%29%20%3E%3D%203%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20and%20strpos%28%24address%2C%20%27%40%27%29%20%3E%3D%201%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20and%20strpos%28%24address%2C%20%27%40%27%29%20%21%3D%20strlen%28%24address%29%20-%201%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27php%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20default%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%28boolean%29filter_var%28%24address%2C%20FILTER_VALIDATE_EMAIL%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Tells%20whether%20IDNs%20%28Internationalized%20Domain%20Names%29%20are%20supported%20or%20not.%20This%20requires%20the%0D%0A%20%20%20%20%20%2A%20%22intl%22%20and%20%22mbstring%22%20PHP%20extensions.%0D%0A%20%20%20%20%20%2A%20%40return%20bool%20%22true%22%20if%20required%20functions%20for%20IDN%20support%20are%20present%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20idnSupported%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20%40TODO%3A%20Write%20our%20own%20%22idn_to_ascii%22%20function%20for%20PHP%20%3C%3D%205.2.%0D%0A%20%20%20%20%20%20%20%20return%20function_exists%28%27idn_to_ascii%27%29%20and%20function_exists%28%27mb_convert_encoding%27%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Converts%20IDN%20in%20given%20email%20address%20to%20its%20ASCII%20form%2C%20also%20known%20as%20punycode%2C%20if%20possible.%0D%0A%20%20%20%20%20%2A%20Important%3A%20Address%20must%20be%20passed%20in%20same%20encoding%20as%20currently%20set%20in%20PHPMailer%3A%3A%24CharSet.%0D%0A%20%20%20%20%20%2A%20This%20function%20silently%20returns%20unmodified%20address%20if%3A%0D%0A%20%20%20%20%20%2A%20-%20No%20conversion%20is%20necessary%20%28i.e.%20domain%20name%20is%20not%20an%20IDN%2C%20or%20is%20already%20in%20ASCII%20form%29%0D%0A%20%20%20%20%20%2A%20-%20Conversion%20to%20punycode%20is%20impossible%20%28e.g.%20required%20PHP%20functions%20are%20not%20available%29%0D%0A%20%20%20%20%20%2A%20%20%20or%20fails%20for%20any%20reason%20%28e.g.%20domain%20has%20characters%20not%20allowed%20in%20an%20IDN%29%0D%0A%20%20%20%20%20%2A%20%40see%20PHPMailer%3A%3A%24CharSet%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24address%20The%20email%20address%20to%20convert%0D%0A%20%20%20%20%20%2A%20%40return%20string%20The%20encoded%20address%20in%20ASCII%20form%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20punyencodeAddress%28%24address%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Verify%20we%20have%20required%20functions%2C%20CharSet%2C%20and%20at-sign.%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3EidnSupported%28%29%20and%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%21empty%28%24this-%3ECharSet%29%20and%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%28%24pos%20%3D%20strrpos%28%24address%2C%20%27%40%27%29%29%20%21%3D%3D%20false%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24domain%20%3D%20substr%28%24address%2C%20%2B%2B%24pos%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Verify%20CharSet%20string%20is%20a%20valid%20one%2C%20and%20domain%20properly%20encoded%20in%20this%20CharSet.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3Ehas8bitChars%28%24domain%29%20and%20%40mb_check_encoding%28%24domain%2C%20%24this-%3ECharSet%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24domain%20%3D%20mb_convert_encoding%28%24domain%2C%20%27UTF-8%27%2C%20%24this-%3ECharSet%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%28%24punycode%20%3D%20defined%28%27INTL_IDNA_VARIANT_UTS46%27%29%20%3F%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20idn_to_ascii%28%24domain%2C%200%2C%20INTL_IDNA_VARIANT_UTS46%29%20%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20idn_to_ascii%28%24domain%29%29%20%21%3D%3D%20false%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20substr%28%24address%2C%200%2C%20%24pos%29%20.%20%24punycode%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%24address%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Create%20a%20message%20and%20send%20it.%0D%0A%20%20%20%20%20%2A%20Uses%20the%20sending%20method%20specified%20by%20%24Mailer.%0D%0A%20%20%20%20%20%2A%20%40throws%20phpmailerException%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%20false%20on%20error%20-%20See%20the%20ErrorInfo%20property%20for%20details%20of%20the%20error.%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20send%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20try%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24this-%3EpreSend%28%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%24this-%3EpostSend%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20catch%20%28phpmailerException%20%24exc%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EmailHeader%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%24exc-%3EgetMessage%28%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3Eexceptions%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20%24exc%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Prepare%20a%20message%20for%20sending.%0D%0A%20%20%20%20%20%2A%20%40throws%20phpmailerException%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20preSend%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20try%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eerror_count%20%3D%200%3B%20%2F%2F%20Reset%20errors%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EmailHeader%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Dequeue%20recipient%20and%20Reply-To%20addresses%20with%20IDN%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20foreach%20%28array_merge%28%24this-%3ERecipientsQueue%2C%20%24this-%3EReplyToQueue%29%20as%20%24params%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24params%5B1%5D%20%3D%20%24this-%3EpunyencodeAddress%28%24params%5B1%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20call_user_func_array%28array%28%24this%2C%20%27addAnAddress%27%29%2C%20%24params%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%28count%28%24this-%3Eto%29%20%2B%20count%28%24this-%3Ecc%29%20%2B%20count%28%24this-%3Ebcc%29%29%20%3C%201%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27provide_address%27%29%2C%20self%3A%3ASTOP_CRITICAL%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Validate%20From%2C%20Sender%2C%20and%20ConfirmReadingTo%20addresses%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20foreach%20%28array%28%27From%27%2C%20%27Sender%27%2C%20%27ConfirmReadingTo%27%29%20as%20%24address_kind%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3E%24address_kind%20%3D%20trim%28%24this-%3E%24address_kind%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28empty%28%24this-%3E%24address_kind%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3E%24address_kind%20%3D%20%24this-%3EpunyencodeAddress%28%24this-%3E%24address_kind%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24this-%3EvalidateAddress%28%24this-%3E%24address_kind%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24error_message%20%3D%20%24this-%3Elang%28%27invalid_address%27%29%20.%20%27%20%28punyEncode%29%20%27%20.%20%24this-%3E%24address_kind%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%24error_message%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%24error_message%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3Eexceptions%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24error_message%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Set%20whether%20the%20message%20is%20multipart%2Falternative%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3EalternativeExists%28%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EContentType%20%3D%20%27multipart%2Falternative%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetMessageType%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Refuse%20to%20send%20an%20empty%20message%20unless%20we%20are%20specifically%20allowing%20it%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24this-%3EAllowEmpty%20and%20empty%28%24this-%3EBody%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27empty_message%27%29%2C%20self%3A%3ASTOP_CRITICAL%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Create%20body%20before%20headers%20in%20case%20body%20makes%20changes%20to%20headers%20%28e.g.%20altering%20transfer%20encoding%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EMIMEHeader%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EMIMEBody%20%3D%20%24this-%3EcreateBody%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20createBody%20may%20have%20added%20some%20headers%2C%20so%20retain%20them%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24tempheaders%20%3D%20%24this-%3EMIMEHeader%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EMIMEHeader%20%3D%20%24this-%3EcreateHeader%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EMIMEHeader%20.%3D%20%24tempheaders%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20To%20capture%20the%20complete%20message%20when%20using%20mail%28%29%2C%20create%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20an%20extra%20header%20list%20which%20createHeader%28%29%20doesn%27t%20fold%20in%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3EMailer%20%3D%3D%20%27mail%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28count%28%24this-%3Eto%29%20%3E%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EmailHeader%20.%3D%20%24this-%3EaddrAppend%28%27To%27%2C%20%24this-%3Eto%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EmailHeader%20.%3D%20%24this-%3EheaderLine%28%27To%27%2C%20%27undisclosed-recipients%3A%3B%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EmailHeader%20.%3D%20%24this-%3EheaderLine%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27Subject%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EencodeHeader%28%24this-%3EsecureHeader%28trim%28%24this-%3ESubject%29%29%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Sign%20with%20DKIM%20if%20enabled%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21empty%28%24this-%3EDKIM_domain%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20and%20%21empty%28%24this-%3EDKIM_selector%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20and%20%28%21empty%28%24this-%3EDKIM_private_string%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20or%20%28%21empty%28%24this-%3EDKIM_private%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20and%20self%3A%3AisPermittedPath%28%24this-%3EDKIM_private%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20and%20file_exists%28%24this-%3EDKIM_private%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24header_dkim%20%3D%20%24this-%3EDKIM_Add%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EMIMEHeader%20.%20%24this-%3EmailHeader%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EencodeHeader%28%24this-%3EsecureHeader%28%24this-%3ESubject%29%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EMIMEBody%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EMIMEHeader%20%3D%20rtrim%28%24this-%3EMIMEHeader%2C%20%22%5Cr%5Cn%20%22%29%20.%20self%3A%3ACRLF%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20str_replace%28%22%5Cr%5Cn%22%2C%20%22%5Cn%22%2C%20%24header_dkim%29%20.%20self%3A%3ACRLF%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20catch%20%28phpmailerException%20%24exc%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%24exc-%3EgetMessage%28%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3Eexceptions%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20%24exc%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Actually%20send%20a%20message.%0D%0A%20%20%20%20%20%2A%20Send%20the%20email%20via%20the%20selected%20mechanism%0D%0A%20%20%20%20%20%2A%20%40throws%20phpmailerException%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20postSend%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20try%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Choose%20the%20mailer%20and%20send%20through%20it%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20switch%20%28%24this-%3EMailer%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20case%20%27sendmail%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20case%20%27qmail%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%24this-%3EsendmailSend%28%24this-%3EMIMEHeader%2C%20%24this-%3EMIMEBody%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20case%20%27smtp%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%24this-%3EsmtpSend%28%24this-%3EMIMEHeader%2C%20%24this-%3EMIMEBody%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20case%20%27mail%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%24this-%3EmailSend%28%24this-%3EMIMEHeader%2C%20%24this-%3EMIMEBody%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20default%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24sendMethod%20%3D%20%24this-%3EMailer.%27Send%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28method_exists%28%24this%2C%20%24sendMethod%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%24this-%3E%24sendMethod%28%24this-%3EMIMEHeader%2C%20%24this-%3EMIMEBody%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%24this-%3EmailSend%28%24this-%3EMIMEHeader%2C%20%24this-%3EMIMEBody%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%20catch%20%28phpmailerException%20%24exc%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%24exc-%3EgetMessage%28%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%24exc-%3EgetMessage%28%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3Eexceptions%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20%24exc%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20mail%20using%20the%20%24Sendmail%20program.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24header%20The%20message%20headers%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24body%20The%20message%20body%0D%0A%20%20%20%20%20%2A%20%40see%20PHPMailer%3A%3A%24Sendmail%0D%0A%20%20%20%20%20%2A%20%40throws%20phpmailerException%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20sendmailSend%28%24header%2C%20%24body%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20CVE-2016-10033%2C%20CVE-2016-10045%3A%20Don%27t%20pass%20-f%20if%20characters%20will%20be%20escaped.%0D%0A%20%20%20%20%20%20%20%20if%20%28%21empty%28%24this-%3ESender%29%20and%20self%3A%3AisShellSafe%28%24this-%3ESender%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3EMailer%20%3D%3D%20%27qmail%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24sendmailFmt%20%3D%20%27%25s%20-f%25s%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24sendmailFmt%20%3D%20%27%25s%20-oi%20-f%25s%20-t%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3EMailer%20%3D%3D%20%27qmail%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24sendmailFmt%20%3D%20%27%25s%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24sendmailFmt%20%3D%20%27%25s%20-oi%20-t%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20TODO%3A%20If%20possible%2C%20this%20should%20be%20changed%20to%20escapeshellarg.%20%20Needs%20thorough%20testing.%0D%0A%20%20%20%20%20%20%20%20%24sendmail%20%3D%20sprintf%28%24sendmailFmt%2C%20escapeshellcmd%28%24this-%3ESendmail%29%2C%20%24this-%3ESender%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3ESingleTo%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20foreach%20%28%24this-%3ESingleToArray%20as%20%24toAddr%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%40%24mail%20%3D%20popen%28%24sendmail%2C%20%27w%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27execute%27%29%20.%20%24this-%3ESendmail%2C%20self%3A%3ASTOP_CRITICAL%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fputs%28%24mail%2C%20%27To%3A%20%27%20.%20%24toAddr%20.%20%22%5Cn%22%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fputs%28%24mail%2C%20%24header%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20fputs%28%24mail%2C%20%24body%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24result%20%3D%20pclose%28%24mail%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EdoCallback%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%28%24result%20%3D%3D%200%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20array%28%24toAddr%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Ecc%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Ebcc%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ESubject%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EFrom%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24result%20%21%3D%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27execute%27%29%20.%20%24this-%3ESendmail%2C%20self%3A%3ASTOP_CRITICAL%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%40%24mail%20%3D%20popen%28%24sendmail%2C%20%27w%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27execute%27%29%20.%20%24this-%3ESendmail%2C%20self%3A%3ASTOP_CRITICAL%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20fputs%28%24mail%2C%20%24header%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20fputs%28%24mail%2C%20%24body%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20%3D%20pclose%28%24mail%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EdoCallback%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%28%24result%20%3D%3D%200%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eto%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Ecc%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Ebcc%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ESubject%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EFrom%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24result%20%21%3D%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27execute%27%29%20.%20%24this-%3ESendmail%2C%20self%3A%3ASTOP_CRITICAL%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Fix%20CVE-2016-10033%20and%20CVE-2016-10045%20by%20disallowing%20potentially%20unsafe%20shell%20characters.%0D%0A%20%20%20%20%20%2A%0D%0A%20%20%20%20%20%2A%20Note%20that%20escapeshellarg%20and%20escapeshellcmd%20are%20inadequate%20for%20our%20purposes%2C%20especially%20on%20Windows.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24string%20The%20string%20to%20be%20validated%0D%0A%20%20%20%20%20%2A%20%40see%20https%3A%2F%2Fgithub.com%2FPHPMailer%2FPHPMailer%2Fissues%2F924%20CVE-2016-10045%20bug%20report%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20static%20function%20isShellSafe%28%24string%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Future-proof%0D%0A%20%20%20%20%20%20%20%20if%20%28escapeshellcmd%28%24string%29%20%21%3D%3D%20%24string%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20or%20%21in_array%28escapeshellarg%28%24string%29%2C%20array%28%22%27%24string%27%22%2C%20%22%5C%22%24string%5C%22%22%29%29%0D%0A%20%20%20%20%20%20%20%20%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24length%20%3D%20strlen%28%24string%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20for%20%28%24i%20%3D%200%3B%20%24i%20%3C%20%24length%3B%20%24i%2B%2B%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24c%20%3D%20%24string%5B%24i%5D%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20All%20other%20characters%20have%20a%20special%20meaning%20in%20at%20least%20one%20common%20shell%2C%20including%20%3D%20and%20%2B.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Full%20stop%20%28.%29%20has%20a%20special%20meaning%20in%20cmd.exe%2C%20but%20its%20impact%20should%20be%20negligible%20here.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Note%20that%20this%20does%20permit%20non-Latin%20alphanumeric%20characters%20based%20on%20the%20current%20locale.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21ctype_alnum%28%24c%29%20%26%26%20strpos%28%27%40_-.%27%2C%20%24c%29%20%3D%3D%3D%20false%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Check%20whether%20a%20file%20path%20is%20of%20a%20permitted%20type.%0D%0A%20%20%20%20%20%2A%20Used%20to%20reject%20URLs%20and%20phar%20files%20from%20functions%20that%20access%20local%20file%20paths%2C%0D%0A%20%20%20%20%20%2A%20such%20as%20addAttachment.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24path%20A%20relative%20or%20absolute%20path%20to%20a%20file.%0D%0A%20%20%20%20%20%2A%20%40return%20bool%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20static%20function%20isPermittedPath%28%24path%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%21preg_match%28%27%23%5E%5Ba-z%5D%2B%3A%2F%2F%23i%27%2C%20%24path%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20mail%20using%20the%20PHP%20mail%28%29%20function.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24header%20The%20message%20headers%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24body%20The%20message%20body%0D%0A%20%20%20%20%20%2A%20%40link%20http%3A%2F%2Fwww.php.net%2Fmanual%2Fen%2Fbook.mail.php%0D%0A%20%20%20%20%20%2A%20%40throws%20phpmailerException%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20mailSend%28%24header%2C%20%24body%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24toArr%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20foreach%20%28%24this-%3Eto%20as%20%24toaddr%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24toArr%5B%5D%20%3D%20%24this-%3EaddrFormat%28%24toaddr%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24to%20%3D%20implode%28%27%2C%20%27%2C%20%24toArr%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24params%20%3D%20null%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2FThis%20sets%20the%20SMTP%20envelope%20sender%20which%20gets%20turned%20into%20a%20return-path%20header%20by%20the%20receiver%0D%0A%20%20%20%20%20%20%20%20if%20%28%21empty%28%24this-%3ESender%29%20and%20%24this-%3EvalidateAddress%28%24this-%3ESender%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20CVE-2016-10033%2C%20CVE-2016-10045%3A%20Don%27t%20pass%20-f%20if%20characters%20will%20be%20escaped.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28self%3A%3AisShellSafe%28%24this-%3ESender%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24params%20%3D%20sprintf%28%27-f%25s%27%2C%20%24this-%3ESender%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28%21empty%28%24this-%3ESender%29%20and%20%21ini_get%28%27safe_mode%27%29%20and%20%24this-%3EvalidateAddress%28%24this-%3ESender%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24old_from%20%3D%20ini_get%28%27sendmail_from%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20ini_set%28%27sendmail_from%27%2C%20%24this-%3ESender%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24result%20%3D%20false%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3ESingleTo%20and%20count%28%24toArr%29%20%3E%201%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20foreach%20%28%24toArr%20as%20%24toAddr%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24result%20%3D%20%24this-%3EmailPassthru%28%24toAddr%2C%20%24this-%3ESubject%2C%20%24body%2C%20%24header%2C%20%24params%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EdoCallback%28%24result%2C%20array%28%24toAddr%29%2C%20%24this-%3Ecc%2C%20%24this-%3Ebcc%2C%20%24this-%3ESubject%2C%20%24body%2C%20%24this-%3EFrom%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20%3D%20%24this-%3EmailPassthru%28%24to%2C%20%24this-%3ESubject%2C%20%24body%2C%20%24header%2C%20%24params%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EdoCallback%28%24result%2C%20%24this-%3Eto%2C%20%24this-%3Ecc%2C%20%24this-%3Ebcc%2C%20%24this-%3ESubject%2C%20%24body%2C%20%24this-%3EFrom%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28isset%28%24old_from%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20ini_set%28%27sendmail_from%27%2C%20%24old_from%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28%21%24result%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27instantiate%27%29%2C%20self%3A%3ASTOP_CRITICAL%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Get%20an%20instance%20to%20use%20for%20SMTP%20operations.%0D%0A%20%20%20%20%20%2A%20Override%20this%20function%20to%20load%20your%20own%20SMTP%20implementation%0D%0A%20%20%20%20%20%2A%20%40return%20SMTP%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getSMTPInstance%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%21is_object%28%24this-%3Esmtp%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Esmtp%20%3D%20new%20SMTP%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3Esmtp%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Send%20mail%20via%20SMTP.%0D%0A%20%20%20%20%20%2A%20Returns%20false%20if%20there%20is%20a%20bad%20MAIL%20FROM%2C%20RCPT%2C%20or%20DATA%20input.%0D%0A%20%20%20%20%20%2A%20Uses%20the%20PHPMailerSMTP%20class%20by%20default.%0D%0A%20%20%20%20%20%2A%20%40see%20PHPMailer%3A%3AgetSMTPInstance%28%29%20to%20use%20a%20different%20class.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24header%20The%20message%20headers%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24body%20The%20message%20body%0D%0A%20%20%20%20%20%2A%20%40throws%20phpmailerException%0D%0A%20%20%20%20%20%2A%20%40uses%20SMTP%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20smtpSend%28%24header%2C%20%24body%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24bad_rcpt%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%21%24this-%3EsmtpConnect%28%24this-%3ESMTPOptions%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27smtp_connect_failed%27%29%2C%20self%3A%3ASTOP_CRITICAL%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28%21empty%28%24this-%3ESender%29%20and%20%24this-%3EvalidateAddress%28%24this-%3ESender%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24smtp_from%20%3D%20%24this-%3ESender%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24smtp_from%20%3D%20%24this-%3EFrom%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28%21%24this-%3Esmtp-%3Email%28%24smtp_from%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%24this-%3Elang%28%27from_failed%27%29%20.%20%24smtp_from%20.%20%27%20%3A%20%27%20.%20implode%28%27%2C%27%2C%20%24this-%3Esmtp-%3EgetError%28%29%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3EErrorInfo%2C%20self%3A%3ASTOP_CRITICAL%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Attempt%20to%20send%20to%20all%20recipients%0D%0A%20%20%20%20%20%20%20%20foreach%20%28array%28%24this-%3Eto%2C%20%24this-%3Ecc%2C%20%24this-%3Ebcc%29%20as%20%24togroup%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20foreach%20%28%24togroup%20as%20%24to%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24this-%3Esmtp-%3Erecipient%28%24to%5B0%5D%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24error%20%3D%20%24this-%3Esmtp-%3EgetError%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24bad_rcpt%5B%5D%20%3D%20array%28%27to%27%20%3D%3E%20%24to%5B0%5D%2C%20%27error%27%20%3D%3E%20%24error%5B%27detail%27%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24isSent%20%3D%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24isSent%20%3D%20true%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EdoCallback%28%24isSent%2C%20array%28%24to%5B0%5D%29%2C%20array%28%29%2C%20array%28%29%2C%20%24this-%3ESubject%2C%20%24body%2C%20%24this-%3EFrom%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Only%20send%20the%20DATA%20command%20if%20we%20have%20viable%20recipients%0D%0A%20%20%20%20%20%20%20%20if%20%28%28count%28%24this-%3Eall_recipients%29%20%3E%20count%28%24bad_rcpt%29%29%20and%20%21%24this-%3Esmtp-%3Edata%28%24header%20.%20%24body%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27data_not_accepted%27%29%2C%20self%3A%3ASTOP_CRITICAL%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3ESMTPKeepAlive%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Esmtp-%3Ereset%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Esmtp-%3Equit%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Esmtp-%3Eclose%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2FCreate%20error%20message%20for%20any%20bad%20addresses%0D%0A%20%20%20%20%20%20%20%20if%20%28count%28%24bad_rcpt%29%20%3E%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24errstr%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20foreach%20%28%24bad_rcpt%20as%20%24bad%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24errstr%20.%3D%20%24bad%5B%27to%27%5D%20.%20%27%3A%20%27%20.%20%24bad%5B%27error%27%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Elang%28%27recipients_failed%27%29%20.%20%24errstr%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20self%3A%3ASTOP_CONTINUE%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Initiate%20a%20connection%20to%20an%20SMTP%20server.%0D%0A%20%20%20%20%20%2A%20Returns%20false%20if%20the%20operation%20failed.%0D%0A%20%20%20%20%20%2A%20%40param%20array%20%24options%20An%20array%20of%20options%20compatible%20with%20stream_context_create%28%29%0D%0A%20%20%20%20%20%2A%20%40uses%20SMTP%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40throws%20phpmailerException%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20smtpConnect%28%24options%20%3D%20null%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28is_null%28%24this-%3Esmtp%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Esmtp%20%3D%20%24this-%3EgetSMTPInstance%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2FIf%20no%20options%20are%20provided%2C%20use%20whatever%20is%20set%20in%20the%20instance%0D%0A%20%20%20%20%20%20%20%20if%20%28is_null%28%24options%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24options%20%3D%20%24this-%3ESMTPOptions%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Already%20connected%3F%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3Esmtp-%3Econnected%28%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24this-%3Esmtp-%3EsetTimeout%28%24this-%3ETimeout%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Esmtp-%3EsetDebugLevel%28%24this-%3ESMTPDebug%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Esmtp-%3EsetDebugOutput%28%24this-%3EDebugoutput%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Esmtp-%3EsetVerp%28%24this-%3Edo_verp%29%3B%0D%0A%20%20%20%20%20%20%20%20%24hosts%20%3D%20explode%28%27%3B%27%2C%20%24this-%3EHost%29%3B%0D%0A%20%20%20%20%20%20%20%20%24lastexception%20%3D%20null%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20foreach%20%28%24hosts%20as%20%24hostentry%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24hostinfo%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21preg_match%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%2F%5E%28%28ssl%7Ctls%29%3A%5C%2F%5C%2F%29%2A%28%5Ba-zA-Z0-9%5C.-%5D%2A%7C%5C%5B%5Ba-fA-F0-9%3A%5D%2B%5C%5D%29%3A%3F%28%5B0-9%5D%2A%29%24%2F%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20trim%28%24hostentry%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24hostinfo%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Not%20a%20valid%20host%20entry%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%27Ignoring%20invalid%20host%3A%20%27%20.%20%24hostentry%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20%24hostinfo%5B2%5D%3A%20optional%20ssl%20or%20tls%20prefix%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20%24hostinfo%5B3%5D%3A%20the%20hostname%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20%24hostinfo%5B4%5D%3A%20optional%20port%20number%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20The%20host%20string%20prefix%20can%20temporarily%20override%20the%20current%20setting%20for%20SMTPSecure%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20If%20it%27s%20not%20specified%2C%20the%20default%20value%20is%20used%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24prefix%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24secure%20%3D%20%24this-%3ESMTPSecure%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24tls%20%3D%20%28%24this-%3ESMTPSecure%20%3D%3D%20%27tls%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%27ssl%27%20%3D%3D%20%24hostinfo%5B2%5D%20or%20%28%27%27%20%3D%3D%20%24hostinfo%5B2%5D%20and%20%27ssl%27%20%3D%3D%20%24this-%3ESMTPSecure%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24prefix%20%3D%20%27ssl%3A%2F%2F%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24tls%20%3D%20false%3B%20%2F%2F%20Can%27t%20have%20SSL%20and%20TLS%20at%20the%20same%20time%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24secure%20%3D%20%27ssl%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20elseif%20%28%24hostinfo%5B2%5D%20%3D%3D%20%27tls%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24tls%20%3D%20true%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20tls%20doesn%27t%20use%20a%20prefix%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24secure%20%3D%20%27tls%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FDo%20we%20need%20the%20OpenSSL%20extension%3F%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24sslext%20%3D%20defined%28%27OPENSSL_ALGO_SHA1%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%27tls%27%20%3D%3D%3D%20%24secure%20or%20%27ssl%27%20%3D%3D%3D%20%24secure%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FCheck%20for%20an%20OpenSSL%20constant%20rather%20than%20using%20extension_loaded%2C%20which%20is%20sometimes%20disabled%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24sslext%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27extension_missing%27%29.%27openssl%27%2C%20self%3A%3ASTOP_CRITICAL%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24host%20%3D%20%24hostinfo%5B3%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24port%20%3D%20%24this-%3EPort%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24tport%20%3D%20%28integer%29%24hostinfo%5B4%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24tport%20%3E%200%20and%20%24tport%20%3C%2065536%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24port%20%3D%20%24tport%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3Esmtp-%3Econnect%28%24prefix%20.%20%24host%2C%20%24port%2C%20%24this-%3ETimeout%2C%20%24options%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20try%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3EHelo%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24hello%20%3D%20%24this-%3EHelo%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24hello%20%3D%20%24this-%3EserverHostname%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Esmtp-%3Ehello%28%24hello%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FAutomatically%20enable%20TLS%20encryption%20if%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20%2A%20it%27s%20not%20disabled%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20%2A%20we%20have%20openssl%20extension%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20%2A%20we%20are%20not%20already%20using%20SSL%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20%2A%20the%20server%20offers%20STARTTLS%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3ESMTPAutoTLS%20and%20%24sslext%20and%20%24secure%20%21%3D%20%27ssl%27%20and%20%24this-%3Esmtp-%3EgetServerExt%28%27STARTTLS%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24tls%20%3D%20true%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24tls%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24this-%3Esmtp-%3EstartTLS%28%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27connect_host%27%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20We%20must%20resend%20EHLO%20after%20TLS%20negotiation%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Esmtp-%3Ehello%28%24hello%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3ESMTPAuth%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24this-%3Esmtp-%3Eauthenticate%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EUsername%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EPassword%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EAuthType%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ERealm%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EWorkstation%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27authenticate%27%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20catch%20%28phpmailerException%20%24exc%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24lastexception%20%3D%20%24exc%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%24exc-%3EgetMessage%28%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20We%20must%20have%20connected%2C%20but%20then%20failed%20TLS%20or%20Auth%2C%20so%20close%20connection%20nicely%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Esmtp-%3Equit%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20If%20we%20get%20here%2C%20all%20connection%20attempts%20have%20failed%2C%20so%20close%20connection%20hard%0D%0A%20%20%20%20%20%20%20%20%24this-%3Esmtp-%3Eclose%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20As%20we%27ve%20caught%20all%20exceptions%2C%20just%20report%20whatever%20the%20last%20one%20was%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3Eexceptions%20and%20%21is_null%28%24lastexception%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20throw%20%24lastexception%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Close%20the%20active%20SMTP%20session%20if%20one%20exists.%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20smtpClose%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28is_a%28%24this-%3Esmtp%2C%20%27SMTP%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3Esmtp-%3Econnected%28%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Esmtp-%3Equit%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Esmtp-%3Eclose%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Set%20the%20language%20for%20error%20messages.%0D%0A%20%20%20%20%20%2A%20Returns%20false%20if%20it%20cannot%20load%20the%20language%20file.%0D%0A%20%20%20%20%20%2A%20The%20default%20language%20is%20English.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24langcode%20ISO%20639-1%202-character%20language%20code%20%28e.g.%20French%20is%20%22fr%22%29%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24lang_path%20Path%20to%20the%20language%20file%20directory%2C%20with%20trailing%20separator%20%28slash%29%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20setLanguage%28%24langcode%20%3D%20%27en%27%2C%20%24lang_path%20%3D%20%27%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Backwards%20compatibility%20for%20renamed%20language%20codes%0D%0A%20%20%20%20%20%20%20%20%24renamed_langcodes%20%3D%20array%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27br%27%20%3D%3E%20%27pt_br%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27cz%27%20%3D%3E%20%27cs%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27dk%27%20%3D%3E%20%27da%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27no%27%20%3D%3E%20%27nb%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27se%27%20%3D%3E%20%27sv%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27sr%27%20%3D%3E%20%27rs%27%0D%0A%20%20%20%20%20%20%20%20%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20if%20%28isset%28%24renamed_langcodes%5B%24langcode%5D%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24langcode%20%3D%20%24renamed_langcodes%5B%24langcode%5D%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Define%20full%20set%20of%20translatable%20strings%20in%20English%0D%0A%20%20%20%20%20%20%20%20%24PHPMAILER_LANG%20%3D%20array%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27authenticate%27%20%3D%3E%20%27SMTP%20Error%3A%20Could%20not%20authenticate.%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27connect_host%27%20%3D%3E%20%27SMTP%20Error%3A%20Could%20not%20connect%20to%20SMTP%20host.%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27data_not_accepted%27%20%3D%3E%20%27SMTP%20Error%3A%20data%20not%20accepted.%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27empty_message%27%20%3D%3E%20%27Message%20body%20empty%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27encoding%27%20%3D%3E%20%27Unknown%20encoding%3A%20%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27execute%27%20%3D%3E%20%27Could%20not%20execute%3A%20%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27file_access%27%20%3D%3E%20%27Could%20not%20access%20file%3A%20%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27file_open%27%20%3D%3E%20%27File%20Error%3A%20Could%20not%20open%20file%3A%20%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27from_failed%27%20%3D%3E%20%27The%20following%20From%20address%20failed%3A%20%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27instantiate%27%20%3D%3E%20%27Could%20not%20instantiate%20mail%20function.%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27invalid_address%27%20%3D%3E%20%27Invalid%20address%3A%20%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27mailer_not_supported%27%20%3D%3E%20%27%20mailer%20is%20not%20supported.%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27provide_address%27%20%3D%3E%20%27You%20must%20provide%20at%20least%20one%20recipient%20email%20address.%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27recipients_failed%27%20%3D%3E%20%27SMTP%20Error%3A%20The%20following%20recipients%20failed%3A%20%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27signing%27%20%3D%3E%20%27Signing%20Error%3A%20%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27smtp_connect_failed%27%20%3D%3E%20%27SMTP%20connect%28%29%20failed.%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27smtp_error%27%20%3D%3E%20%27SMTP%20server%20error%3A%20%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27variable_set%27%20%3D%3E%20%27Cannot%20set%20or%20reset%20variable%3A%20%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27extension_missing%27%20%3D%3E%20%27Extension%20missing%3A%20%27%0D%0A%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28empty%28%24lang_path%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Calculate%20an%20absolute%20path%20so%20it%20can%20work%20if%20CWD%20is%20not%20here%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24lang_path%20%3D%20dirname%28__FILE__%29.%20DIRECTORY_SEPARATOR%20.%20%27language%27.%20DIRECTORY_SEPARATOR%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2FValidate%20%24langcode%0D%0A%20%20%20%20%20%20%20%20if%20%28%21preg_match%28%27%2F%5E%5Ba-z%5D%7B2%7D%28%3F%3A_%5Ba-zA-Z%5D%7B2%7D%29%3F%24%2F%27%2C%20%24langcode%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24langcode%20%3D%20%27en%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24foundlang%20%3D%20true%3B%0D%0A%20%20%20%20%20%20%20%20%24lang_file%20%3D%20%24lang_path%20.%20%27phpmailer.lang-%27%20.%20%24langcode%20.%20%27.php%27%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20There%20is%20no%20English%20translation%20file%0D%0A%20%20%20%20%20%20%20%20if%20%28%24langcode%20%21%3D%20%27en%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Make%20sure%20language%20file%20path%20is%20readable%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21self%3A%3AisPermittedPath%28%24lang_file%29%20or%20%21is_readable%28%24lang_file%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24foundlang%20%3D%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Overwrite%20language-specific%20strings.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20This%20way%20we%27ll%20never%20have%20missing%20translation%20keys.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24foundlang%20%3D%20include%20%24lang_file%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24this-%3Elanguage%20%3D%20%24PHPMAILER_LANG%3B%0D%0A%20%20%20%20%20%20%20%20return%20%28boolean%29%24foundlang%3B%20%2F%2F%20Returns%20false%20if%20language%20not%20found%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Get%20the%20array%20of%20strings%20for%20the%20current%20language.%0D%0A%20%20%20%20%20%2A%20%40return%20array%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getTranslations%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3Elanguage%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Create%20recipient%20headers.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24type%0D%0A%20%20%20%20%20%2A%20%40param%20array%20%24addr%20An%20array%20of%20recipient%2C%0D%0A%20%20%20%20%20%2A%20where%20each%20recipient%20is%20a%202-element%20indexed%20array%20with%20element%200%20containing%20an%20address%0D%0A%20%20%20%20%20%2A%20and%20element%201%20containing%20a%20name%2C%20like%3A%0D%0A%20%20%20%20%20%2A%20array%28array%28%27joe%40example.com%27%2C%20%27Joe%20User%27%29%2C%20array%28%27zoe%40example.com%27%2C%20%27Zoe%20User%27%29%29%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20addrAppend%28%24type%2C%20%24addr%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24addresses%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20foreach%20%28%24addr%20as%20%24address%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24addresses%5B%5D%20%3D%20%24this-%3EaddrFormat%28%24address%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%24type%20.%20%27%3A%20%27%20.%20implode%28%27%2C%20%27%2C%20%24addresses%29%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Format%20an%20address%20for%20use%20in%20a%20message%20header.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20array%20%24addr%20A%202-element%20indexed%20array%2C%20element%200%20containing%20an%20address%2C%20element%201%20containing%20a%20name%0D%0A%20%20%20%20%20%2A%20%20%20%20%20%20like%20array%28%27joe%40example.com%27%2C%20%27Joe%20User%27%29%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20addrFormat%28%24addr%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28empty%28%24addr%5B1%5D%29%29%20%7B%20%2F%2F%20No%20name%20provided%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%24this-%3EsecureHeader%28%24addr%5B0%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%24this-%3EencodeHeader%28%24this-%3EsecureHeader%28%24addr%5B1%5D%29%2C%20%27phrase%27%29%20.%20%27%20%3C%27%20.%20%24this-%3EsecureHeader%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24addr%5B0%5D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%20.%20%27%3E%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Word-wrap%20message.%0D%0A%20%20%20%20%20%2A%20For%20use%20with%20mailers%20that%20do%20not%20automatically%20perform%20wrapping%0D%0A%20%20%20%20%20%2A%20and%20for%20quoted-printable%20encoded%20messages.%0D%0A%20%20%20%20%20%2A%20Original%20written%20by%20philippe.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24message%20The%20message%20to%20wrap%0D%0A%20%20%20%20%20%2A%20%40param%20integer%20%24length%20The%20line%20length%20to%20wrap%20to%0D%0A%20%20%20%20%20%2A%20%40param%20boolean%20%24qp_mode%20Whether%20to%20run%20in%20Quoted-Printable%20mode%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20wrapText%28%24message%2C%20%24length%2C%20%24qp_mode%20%3D%20false%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24qp_mode%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24soft_break%20%3D%20sprintf%28%27%20%3D%25s%27%2C%20%24this-%3ELE%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24soft_break%20%3D%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20If%20utf-8%20encoding%20is%20used%2C%20we%20will%20need%20to%20make%20sure%20we%20don%27t%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20split%20multibyte%20characters%20when%20we%20wrap%0D%0A%20%20%20%20%20%20%20%20%24is_utf8%20%3D%20%28strtolower%28%24this-%3ECharSet%29%20%3D%3D%20%27utf-8%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%24lelen%20%3D%20strlen%28%24this-%3ELE%29%3B%0D%0A%20%20%20%20%20%20%20%20%24crlflen%20%3D%20strlen%28self%3A%3ACRLF%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24message%20%3D%20%24this-%3EfixEOL%28%24message%29%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2FRemove%20a%20trailing%20line%20break%0D%0A%20%20%20%20%20%20%20%20if%20%28substr%28%24message%2C%20-%24lelen%29%20%3D%3D%20%24this-%3ELE%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24message%20%3D%20substr%28%24message%2C%200%2C%20-%24lelen%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2FSplit%20message%20into%20lines%0D%0A%20%20%20%20%20%20%20%20%24lines%20%3D%20explode%28%24this-%3ELE%2C%20%24message%29%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2FMessage%20will%20be%20rebuilt%20in%20here%0D%0A%20%20%20%20%20%20%20%20%24message%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20foreach%20%28%24lines%20as%20%24line%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24words%20%3D%20explode%28%27%20%27%2C%20%24line%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24buf%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24firstword%20%3D%20true%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20foreach%20%28%24words%20as%20%24word%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24qp_mode%20and%20%28strlen%28%24word%29%20%3E%20%24length%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24space_left%20%3D%20%24length%20-%20strlen%28%24buf%29%20-%20%24crlflen%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24firstword%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24space_left%20%3E%2020%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24len%20%3D%20%24space_left%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24is_utf8%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24len%20%3D%20%24this-%3Eutf8CharBoundary%28%24word%2C%20%24len%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20elseif%20%28substr%28%24word%2C%20%24len%20-%201%2C%201%29%20%3D%3D%20%27%3D%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24len--%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20elseif%20%28substr%28%24word%2C%20%24len%20-%202%2C%201%29%20%3D%3D%20%27%3D%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24len%20-%3D%202%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24part%20%3D%20substr%28%24word%2C%200%2C%20%24len%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24word%20%3D%20substr%28%24word%2C%20%24len%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24buf%20.%3D%20%27%20%27%20.%20%24part%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24message%20.%3D%20%24buf%20.%20sprintf%28%27%3D%25s%27%2C%20self%3A%3ACRLF%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24message%20.%3D%20%24buf%20.%20%24soft_break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24buf%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20while%20%28strlen%28%24word%29%20%3E%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24length%20%3C%3D%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24len%20%3D%20%24length%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24is_utf8%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24len%20%3D%20%24this-%3Eutf8CharBoundary%28%24word%2C%20%24len%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20elseif%20%28substr%28%24word%2C%20%24len%20-%201%2C%201%29%20%3D%3D%20%27%3D%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24len--%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20elseif%20%28substr%28%24word%2C%20%24len%20-%202%2C%201%29%20%3D%3D%20%27%3D%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24len%20-%3D%202%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24part%20%3D%20substr%28%24word%2C%200%2C%20%24len%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24word%20%3D%20substr%28%24word%2C%20%24len%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28strlen%28%24word%29%20%3E%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24message%20.%3D%20%24part%20.%20sprintf%28%27%3D%25s%27%2C%20self%3A%3ACRLF%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24buf%20%3D%20%24part%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24buf_o%20%3D%20%24buf%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%24firstword%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24buf%20.%3D%20%27%20%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24buf%20.%3D%20%24word%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28strlen%28%24buf%29%20%3E%20%24length%20and%20%24buf_o%20%21%3D%20%27%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24message%20.%3D%20%24buf_o%20.%20%24soft_break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24buf%20%3D%20%24word%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24firstword%20%3D%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24message%20.%3D%20%24buf%20.%20self%3A%3ACRLF%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20return%20%24message%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Find%20the%20last%20character%20boundary%20prior%20to%20%24maxLength%20in%20a%20utf-8%0D%0A%20%20%20%20%20%2A%20quoted-printable%20encoded%20string.%0D%0A%20%20%20%20%20%2A%20Original%20written%20by%20Colin%20Brown.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24encodedText%20utf-8%20QP%20text%0D%0A%20%20%20%20%20%2A%20%40param%20integer%20%24maxLength%20Find%20the%20last%20character%20boundary%20prior%20to%20this%20length%0D%0A%20%20%20%20%20%2A%20%40return%20integer%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20utf8CharBoundary%28%24encodedText%2C%20%24maxLength%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24foundSplitPos%20%3D%20false%3B%0D%0A%20%20%20%20%20%20%20%20%24lookBack%20%3D%203%3B%0D%0A%20%20%20%20%20%20%20%20while%20%28%21%24foundSplitPos%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24lastChunk%20%3D%20substr%28%24encodedText%2C%20%24maxLength%20-%20%24lookBack%2C%20%24lookBack%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24encodedCharPos%20%3D%20strpos%28%24lastChunk%2C%20%27%3D%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28false%20%21%3D%3D%20%24encodedCharPos%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Found%20start%20of%20encoded%20character%20byte%20within%20%24lookBack%20block.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Check%20the%20encoded%20byte%20value%20%28the%202%20chars%20after%20the%20%27%3D%27%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24hex%20%3D%20substr%28%24encodedText%2C%20%24maxLength%20-%20%24lookBack%20%2B%20%24encodedCharPos%20%2B%201%2C%202%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24dec%20%3D%20hexdec%28%24hex%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24dec%20%3C%20128%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Single%20byte%20character.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20If%20the%20encoded%20char%20was%20found%20at%20pos%200%2C%20it%20will%20fit%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20otherwise%20reduce%20maxLength%20to%20start%20of%20the%20encoded%20char%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24encodedCharPos%20%3E%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24maxLength%20%3D%20%24maxLength%20-%20%28%24lookBack%20-%20%24encodedCharPos%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24foundSplitPos%20%3D%20true%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20elseif%20%28%24dec%20%3E%3D%20192%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20First%20byte%20of%20a%20multi%20byte%20character%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Reduce%20maxLength%20to%20split%20at%20start%20of%20character%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24maxLength%20%3D%20%24maxLength%20-%20%28%24lookBack%20-%20%24encodedCharPos%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24foundSplitPos%20%3D%20true%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20elseif%20%28%24dec%20%3C%20192%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Middle%20byte%20of%20a%20multi%20byte%20character%2C%20look%20further%20back%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24lookBack%20%2B%3D%203%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20No%20encoded%20character%20found%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24foundSplitPos%20%3D%20true%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%24maxLength%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Apply%20word%20wrapping%20to%20the%20message%20body.%0D%0A%20%20%20%20%20%2A%20Wraps%20the%20message%20body%20to%20the%20number%20of%20chars%20set%20in%20the%20WordWrap%20property.%0D%0A%20%20%20%20%20%2A%20You%20should%20only%20do%20this%20to%20plain-text%20bodies%20as%20wrapping%20HTML%20tags%20may%20break%20them.%0D%0A%20%20%20%20%20%2A%20This%20is%20called%20automatically%20by%20createBody%28%29%2C%20so%20you%20don%27t%20need%20to%20call%20it%20yourself.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20setWordWrap%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3EWordWrap%20%3C%201%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20switch%20%28%24this-%3Emessage_type%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27alt%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27alt_inline%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27alt_attach%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27alt_inline_attach%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EAltBody%20%3D%20%24this-%3EwrapText%28%24this-%3EAltBody%2C%20%24this-%3EWordWrap%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20default%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EBody%20%3D%20%24this-%3EwrapText%28%24this-%3EBody%2C%20%24this-%3EWordWrap%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Assemble%20message%20headers.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20string%20The%20assembled%20headers%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20createHeader%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24result%20%3D%20%27%27%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EheaderLine%28%27Date%27%2C%20%24this-%3EMessageDate%20%3D%3D%20%27%27%20%3F%20self%3A%3ArfcDate%28%29%20%3A%20%24this-%3EMessageDate%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20To%20be%20created%20automatically%20by%20mail%28%29%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3ESingleTo%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3EMailer%20%21%3D%20%27mail%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20foreach%20%28%24this-%3Eto%20as%20%24toaddr%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ESingleToArray%5B%5D%20%3D%20%24this-%3EaddrFormat%28%24toaddr%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28count%28%24this-%3Eto%29%20%3E%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3EMailer%20%21%3D%20%27mail%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EaddrAppend%28%27To%27%2C%20%24this-%3Eto%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20elseif%20%28count%28%24this-%3Ecc%29%20%3D%3D%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EheaderLine%28%27To%27%2C%20%27undisclosed-recipients%3A%3B%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EaddrAppend%28%27From%27%2C%20array%28array%28trim%28%24this-%3EFrom%29%2C%20%24this-%3EFromName%29%29%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20sendmail%20and%20mail%28%29%20extract%20Cc%20from%20the%20header%20before%20sending%0D%0A%20%20%20%20%20%20%20%20if%20%28count%28%24this-%3Ecc%29%20%3E%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EaddrAppend%28%27Cc%27%2C%20%24this-%3Ecc%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20sendmail%20and%20mail%28%29%20extract%20Bcc%20from%20the%20header%20before%20sending%0D%0A%20%20%20%20%20%20%20%20if%20%28%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EMailer%20%3D%3D%20%27sendmail%27%20or%20%24this-%3EMailer%20%3D%3D%20%27qmail%27%20or%20%24this-%3EMailer%20%3D%3D%20%27mail%27%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20and%20count%28%24this-%3Ebcc%29%20%3E%200%0D%0A%20%20%20%20%20%20%20%20%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EaddrAppend%28%27Bcc%27%2C%20%24this-%3Ebcc%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20if%20%28count%28%24this-%3EReplyTo%29%20%3E%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EaddrAppend%28%27Reply-To%27%2C%20%24this-%3EReplyTo%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20mail%28%29%20sets%20the%20subject%20itself%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3EMailer%20%21%3D%20%27mail%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EheaderLine%28%27Subject%27%2C%20%24this-%3EencodeHeader%28%24this-%3EsecureHeader%28%24this-%3ESubject%29%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Only%20allow%20a%20custom%20message%20ID%20if%20it%20conforms%20to%20RFC%205322%20section%203.6.4%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20https%3A%2F%2Ftools.ietf.org%2Fhtml%2Frfc5322%23section-3.6.4%0D%0A%20%20%20%20%20%20%20%20if%20%28%27%27%20%21%3D%20%24this-%3EMessageID%20and%20preg_match%28%27%2F%5E%3C.%2A%40.%2A%3E%24%2F%27%2C%20%24this-%3EMessageID%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ElastMessageID%20%3D%20%24this-%3EMessageID%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ElastMessageID%20%3D%20sprintf%28%27%3C%25s%40%25s%3E%27%2C%20%24this-%3Euniqueid%2C%20%24this-%3EserverHostname%28%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EheaderLine%28%27Message-ID%27%2C%20%24this-%3ElastMessageID%29%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%21is_null%28%24this-%3EPriority%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EheaderLine%28%27X-Priority%27%2C%20%24this-%3EPriority%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3EXMailer%20%3D%3D%20%27%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EheaderLine%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27X-Mailer%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27PHPMailer%20%27%20.%20%24this-%3EVersion%20.%20%27%20%28https%3A%2F%2Fgithub.com%2FPHPMailer%2FPHPMailer%29%27%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24myXmailer%20%3D%20trim%28%24this-%3EXMailer%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24myXmailer%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EheaderLine%28%27X-Mailer%27%2C%20%24myXmailer%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3EConfirmReadingTo%20%21%3D%20%27%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EheaderLine%28%27Disposition-Notification-To%27%2C%20%27%3C%27%20.%20%24this-%3EConfirmReadingTo%20.%20%27%3E%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Add%20custom%20headers%0D%0A%20%20%20%20%20%20%20%20foreach%20%28%24this-%3ECustomHeader%20as%20%24header%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EheaderLine%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20trim%28%24header%5B0%5D%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EencodeHeader%28trim%28%24header%5B1%5D%29%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28%21%24this-%3Esign_key_file%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EheaderLine%28%27MIME-Version%27%2C%20%271.0%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EgetMailMIME%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20return%20%24result%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Get%20the%20message%20MIME%20type%20headers.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getMailMIME%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24result%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%24ismultipart%20%3D%20true%3B%0D%0A%20%20%20%20%20%20%20%20switch%20%28%24this-%3Emessage_type%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27inline%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EheaderLine%28%27Content-Type%27%2C%20%27multipart%2Frelated%3B%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EtextLine%28%22%5Ctboundary%3D%5C%22%22%20.%20%24this-%3Eboundary%5B1%5D%20.%20%27%22%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27attach%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27inline_attach%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27alt_attach%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27alt_inline_attach%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EheaderLine%28%27Content-Type%27%2C%20%27multipart%2Fmixed%3B%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EtextLine%28%22%5Ctboundary%3D%5C%22%22%20.%20%24this-%3Eboundary%5B1%5D%20.%20%27%22%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27alt%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27alt_inline%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EheaderLine%28%27Content-Type%27%2C%20%27multipart%2Falternative%3B%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EtextLine%28%22%5Ctboundary%3D%5C%22%22%20.%20%24this-%3Eboundary%5B1%5D%20.%20%27%22%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20default%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Catches%20case%20%27plain%27%3A%20and%20case%20%27%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EtextLine%28%27Content-Type%3A%20%27%20.%20%24this-%3EContentType%20.%20%27%3B%20charset%3D%27%20.%20%24this-%3ECharSet%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24ismultipart%20%3D%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20RFC1341%20part%205%20says%207bit%20is%20assumed%20if%20not%20specified%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3EEncoding%20%21%3D%20%277bit%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20RFC%202045%20section%206.4%20says%20multipart%20MIME%20parts%20may%20only%20use%207bit%2C%208bit%20or%20binary%20CTE%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24ismultipart%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3EEncoding%20%3D%3D%20%278bit%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EheaderLine%28%27Content-Transfer-Encoding%27%2C%20%278bit%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20The%20only%20remaining%20alternatives%20are%20quoted-printable%20and%20base64%2C%20which%20are%20both%207bit%20compatible%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EheaderLine%28%27Content-Transfer-Encoding%27%2C%20%24this-%3EEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3EMailer%20%21%3D%20%27mail%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20return%20%24result%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Returns%20the%20whole%20MIME%20message.%0D%0A%20%20%20%20%20%2A%20Includes%20complete%20headers%20and%20body.%0D%0A%20%20%20%20%20%2A%20Only%20valid%20post%20preSend%28%29.%0D%0A%20%20%20%20%20%2A%20%40see%20PHPMailer%3A%3ApreSend%28%29%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getSentMIMEMessage%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20rtrim%28%24this-%3EMIMEHeader%20.%20%24this-%3EmailHeader%2C%20%22%5Cn%5Cr%22%29%20.%20self%3A%3ACRLF%20.%20self%3A%3ACRLF%20.%20%24this-%3EMIMEBody%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Create%20unique%20ID%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20generateId%28%29%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20md5%28uniqid%28time%28%29%29%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Assemble%20the%20message%20body.%0D%0A%20%20%20%20%20%2A%20Returns%20an%20empty%20string%20on%20failure.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40throws%20phpmailerException%0D%0A%20%20%20%20%20%2A%20%40return%20string%20The%20assembled%20message%20body%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20createBody%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24body%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2FCreate%20unique%20IDs%20and%20preset%20boundaries%0D%0A%20%20%20%20%20%20%20%20%24this-%3Euniqueid%20%3D%20%24this-%3EgenerateId%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eboundary%5B1%5D%20%3D%20%27b1_%27%20.%20%24this-%3Euniqueid%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eboundary%5B2%5D%20%3D%20%27b2_%27%20.%20%24this-%3Euniqueid%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eboundary%5B3%5D%20%3D%20%27b3_%27%20.%20%24this-%3Euniqueid%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3Esign_key_file%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EgetMailMIME%28%29%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24this-%3EsetWordWrap%28%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24bodyEncoding%20%3D%20%24this-%3EEncoding%3B%0D%0A%20%20%20%20%20%20%20%20%24bodyCharSet%20%3D%20%24this-%3ECharSet%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2FCan%20we%20do%20a%207-bit%20downgrade%3F%0D%0A%20%20%20%20%20%20%20%20if%20%28%24bodyEncoding%20%3D%3D%20%278bit%27%20and%20%21%24this-%3Ehas8bitChars%28%24this-%3EBody%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24bodyEncoding%20%3D%20%277bit%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FAll%20ISO%208859%2C%20Windows%20codepage%20and%20UTF-8%20charsets%20are%20ascii%20compatible%20up%20to%207-bit%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24bodyCharSet%20%3D%20%27us-ascii%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2FIf%20lines%20are%20too%20long%2C%20and%20we%27re%20not%20already%20using%20an%20encoding%20that%20will%20shorten%20them%2C%0D%0A%20%20%20%20%20%20%20%20%2F%2Fchange%20to%20quoted-printable%20transfer%20encoding%20for%20the%20body%20part%20only%0D%0A%20%20%20%20%20%20%20%20if%20%28%27base64%27%20%21%3D%20%24this-%3EEncoding%20and%20self%3A%3AhasLineLongerThanMax%28%24this-%3EBody%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24bodyEncoding%20%3D%20%27quoted-printable%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24altBodyEncoding%20%3D%20%24this-%3EEncoding%3B%0D%0A%20%20%20%20%20%20%20%20%24altBodyCharSet%20%3D%20%24this-%3ECharSet%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2FCan%20we%20do%20a%207-bit%20downgrade%3F%0D%0A%20%20%20%20%20%20%20%20if%20%28%24altBodyEncoding%20%3D%3D%20%278bit%27%20and%20%21%24this-%3Ehas8bitChars%28%24this-%3EAltBody%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24altBodyEncoding%20%3D%20%277bit%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FAll%20ISO%208859%2C%20Windows%20codepage%20and%20UTF-8%20charsets%20are%20ascii%20compatible%20up%20to%207-bit%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24altBodyCharSet%20%3D%20%27us-ascii%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2FIf%20lines%20are%20too%20long%2C%20and%20we%27re%20not%20already%20using%20an%20encoding%20that%20will%20shorten%20them%2C%0D%0A%20%20%20%20%20%20%20%20%2F%2Fchange%20to%20quoted-printable%20transfer%20encoding%20for%20the%20alt%20body%20part%20only%0D%0A%20%20%20%20%20%20%20%20if%20%28%27base64%27%20%21%3D%20%24altBodyEncoding%20and%20self%3A%3AhasLineLongerThanMax%28%24this-%3EAltBody%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24altBodyEncoding%20%3D%20%27quoted-printable%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2FUse%20this%20as%20a%20preamble%20in%20all%20multipart%20message%20types%0D%0A%20%20%20%20%20%20%20%20%24mimepre%20%3D%20%22This%20is%20a%20multi-part%20message%20in%20MIME%20format.%22%20.%20%24this-%3ELE%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20switch%20%28%24this-%3Emessage_type%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27inline%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24mimepre%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EgetBoundary%28%24this-%3Eboundary%5B1%5D%2C%20%24bodyCharSet%2C%20%27%27%2C%20%24bodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EencodeString%28%24this-%3EBody%2C%20%24bodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EattachAll%28%27inline%27%2C%20%24this-%3Eboundary%5B1%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27attach%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24mimepre%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EgetBoundary%28%24this-%3Eboundary%5B1%5D%2C%20%24bodyCharSet%2C%20%27%27%2C%20%24bodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EencodeString%28%24this-%3EBody%2C%20%24bodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EattachAll%28%27attachment%27%2C%20%24this-%3Eboundary%5B1%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27inline_attach%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24mimepre%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EtextLine%28%27--%27%20.%20%24this-%3Eboundary%5B1%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EheaderLine%28%27Content-Type%27%2C%20%27multipart%2Frelated%3B%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EtextLine%28%22%5Ctboundary%3D%5C%22%22%20.%20%24this-%3Eboundary%5B2%5D%20.%20%27%22%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EgetBoundary%28%24this-%3Eboundary%5B2%5D%2C%20%24bodyCharSet%2C%20%27%27%2C%20%24bodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EencodeString%28%24this-%3EBody%2C%20%24bodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EattachAll%28%27inline%27%2C%20%24this-%3Eboundary%5B2%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EattachAll%28%27attachment%27%2C%20%24this-%3Eboundary%5B1%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27alt%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24mimepre%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EgetBoundary%28%24this-%3Eboundary%5B1%5D%2C%20%24altBodyCharSet%2C%20%27text%2Fplain%27%2C%20%24altBodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EencodeString%28%24this-%3EAltBody%2C%20%24altBodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EgetBoundary%28%24this-%3Eboundary%5B1%5D%2C%20%24bodyCharSet%2C%20%27text%2Fhtml%27%2C%20%24bodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EencodeString%28%24this-%3EBody%2C%20%24bodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21empty%28%24this-%3EIcal%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EgetBoundary%28%24this-%3Eboundary%5B1%5D%2C%20%27%27%2C%20%27text%2Fcalendar%3B%20method%3DREQUEST%27%2C%20%27%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EencodeString%28%24this-%3EIcal%2C%20%24this-%3EEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EendBoundary%28%24this-%3Eboundary%5B1%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27alt_inline%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24mimepre%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EgetBoundary%28%24this-%3Eboundary%5B1%5D%2C%20%24altBodyCharSet%2C%20%27text%2Fplain%27%2C%20%24altBodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EencodeString%28%24this-%3EAltBody%2C%20%24altBodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EtextLine%28%27--%27%20.%20%24this-%3Eboundary%5B1%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EheaderLine%28%27Content-Type%27%2C%20%27multipart%2Frelated%3B%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EtextLine%28%22%5Ctboundary%3D%5C%22%22%20.%20%24this-%3Eboundary%5B2%5D%20.%20%27%22%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EgetBoundary%28%24this-%3Eboundary%5B2%5D%2C%20%24bodyCharSet%2C%20%27text%2Fhtml%27%2C%20%24bodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EencodeString%28%24this-%3EBody%2C%20%24bodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EattachAll%28%27inline%27%2C%20%24this-%3Eboundary%5B2%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EendBoundary%28%24this-%3Eboundary%5B1%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27alt_attach%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24mimepre%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EtextLine%28%27--%27%20.%20%24this-%3Eboundary%5B1%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EheaderLine%28%27Content-Type%27%2C%20%27multipart%2Falternative%3B%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EtextLine%28%22%5Ctboundary%3D%5C%22%22%20.%20%24this-%3Eboundary%5B2%5D%20.%20%27%22%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EgetBoundary%28%24this-%3Eboundary%5B2%5D%2C%20%24altBodyCharSet%2C%20%27text%2Fplain%27%2C%20%24altBodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EencodeString%28%24this-%3EAltBody%2C%20%24altBodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EgetBoundary%28%24this-%3Eboundary%5B2%5D%2C%20%24bodyCharSet%2C%20%27text%2Fhtml%27%2C%20%24bodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EencodeString%28%24this-%3EBody%2C%20%24bodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EendBoundary%28%24this-%3Eboundary%5B2%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EattachAll%28%27attachment%27%2C%20%24this-%3Eboundary%5B1%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27alt_inline_attach%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24mimepre%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EtextLine%28%27--%27%20.%20%24this-%3Eboundary%5B1%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EheaderLine%28%27Content-Type%27%2C%20%27multipart%2Falternative%3B%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EtextLine%28%22%5Ctboundary%3D%5C%22%22%20.%20%24this-%3Eboundary%5B2%5D%20.%20%27%22%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EgetBoundary%28%24this-%3Eboundary%5B2%5D%2C%20%24altBodyCharSet%2C%20%27text%2Fplain%27%2C%20%24altBodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EencodeString%28%24this-%3EAltBody%2C%20%24altBodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EtextLine%28%27--%27%20.%20%24this-%3Eboundary%5B2%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EheaderLine%28%27Content-Type%27%2C%20%27multipart%2Frelated%3B%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EtextLine%28%22%5Ctboundary%3D%5C%22%22%20.%20%24this-%3Eboundary%5B3%5D%20.%20%27%22%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EgetBoundary%28%24this-%3Eboundary%5B3%5D%2C%20%24bodyCharSet%2C%20%27text%2Fhtml%27%2C%20%24bodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EencodeString%28%24this-%3EBody%2C%20%24bodyEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EattachAll%28%27inline%27%2C%20%24this-%3Eboundary%5B3%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EendBoundary%28%24this-%3Eboundary%5B2%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EattachAll%28%27attachment%27%2C%20%24this-%3Eboundary%5B1%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20default%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Catch%20case%20%27plain%27%20and%20case%20%27%27%2C%20applies%20to%20simple%20%60text%2Fplain%60%20and%20%60text%2Fhtml%60%20body%20content%20types%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FReset%20the%20%60Encoding%60%20property%20in%20case%20we%20changed%20it%20for%20line%20length%20reasons%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EEncoding%20%3D%20%24bodyEncoding%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20.%3D%20%24this-%3EencodeString%28%24this-%3EBody%2C%20%24this-%3EEncoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3EisError%28%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24body%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20elseif%20%28%24this-%3Esign_key_file%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20try%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21defined%28%27PKCS7_TEXT%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27extension_missing%27%29%20.%20%27openssl%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20%40TODO%20would%20be%20nice%20to%20use%20php%3A%2F%2Ftemp%20streams%20here%2C%20but%20need%20to%20wrap%20for%20PHP%20%3C%205.1%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24file%20%3D%20tempnam%28sys_get_temp_dir%28%29%2C%20%27mail%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28false%20%3D%3D%3D%20file_put_contents%28%24file%2C%20%24body%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27signing%27%29%20.%20%27%20Could%20not%20write%20temp%20file%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24signed%20%3D%20tempnam%28sys_get_temp_dir%28%29%2C%20%27signed%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FWorkaround%20for%20PHP%20bug%20https%3A%2F%2Fbugs.php.net%2Fbug.php%3Fid%3D69197%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28empty%28%24this-%3Esign_extracerts_file%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24sign%20%3D%20%40openssl_pkcs7_sign%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24file%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24signed%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27file%3A%2F%2F%27%20.%20realpath%28%24this-%3Esign_cert_file%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20array%28%27file%3A%2F%2F%27%20.%20realpath%28%24this-%3Esign_key_file%29%2C%20%24this-%3Esign_key_pass%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20null%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24sign%20%3D%20%40openssl_pkcs7_sign%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24file%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24signed%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27file%3A%2F%2F%27%20.%20realpath%28%24this-%3Esign_cert_file%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20array%28%27file%3A%2F%2F%27%20.%20realpath%28%24this-%3Esign_key_file%29%2C%20%24this-%3Esign_key_pass%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20null%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20PKCS7_DETACHED%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Esign_extracerts_file%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24sign%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%40unlink%28%24file%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20%3D%20file_get_contents%28%24signed%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%40unlink%28%24signed%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FThe%20message%20returned%20by%20openssl%20contains%20both%20headers%20and%20body%2C%20so%20need%20to%20split%20them%20up%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24parts%20%3D%20explode%28%22%5Cn%5Cn%22%2C%20%24body%2C%202%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EMIMEHeader%20.%3D%20%24parts%5B0%5D%20.%20%24this-%3ELE%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20%3D%20%24parts%5B1%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%40unlink%28%24file%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%40unlink%28%24signed%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27signing%27%29%20.%20openssl_error_string%28%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20catch%20%28phpmailerException%20%24exc%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24body%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3Eexceptions%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20%24exc%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%24body%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Return%20the%20start%20of%20a%20message%20boundary.%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24boundary%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24charSet%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24contentType%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24encoding%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20getBoundary%28%24boundary%2C%20%24charSet%2C%20%24contentType%2C%20%24encoding%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24result%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24charSet%20%3D%3D%20%27%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24charSet%20%3D%20%24this-%3ECharSet%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28%24contentType%20%3D%3D%20%27%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24contentType%20%3D%20%24this-%3EContentType%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28%24encoding%20%3D%3D%20%27%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24encoding%20%3D%20%24this-%3EEncoding%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EtextLine%28%27--%27%20.%20%24boundary%29%3B%0D%0A%20%20%20%20%20%20%20%20%24result%20.%3D%20sprintf%28%27Content-Type%3A%20%25s%3B%20charset%3D%25s%27%2C%20%24contentType%2C%20%24charSet%29%3B%0D%0A%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20RFC1341%20part%205%20says%207bit%20is%20assumed%20if%20not%20specified%0D%0A%20%20%20%20%20%20%20%20if%20%28%24encoding%20%21%3D%20%277bit%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3EheaderLine%28%27Content-Transfer-Encoding%27%2C%20%24encoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24result%20.%3D%20%24this-%3ELE%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20return%20%24result%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Return%20the%20end%20of%20a%20message%20boundary.%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24boundary%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20endBoundary%28%24boundary%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3ELE%20.%20%27--%27%20.%20%24boundary%20.%20%27--%27%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Set%20the%20message%20type.%0D%0A%20%20%20%20%20%2A%20PHPMailer%20only%20supports%20some%20preset%20message%20types%2C%20not%20arbitrary%20MIME%20structures.%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20setMessageType%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24type%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3EalternativeExists%28%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24type%5B%5D%20%3D%20%27alt%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3EinlineImageExists%28%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24type%5B%5D%20%3D%20%27inline%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3EattachmentExists%28%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24type%5B%5D%20%3D%20%27attach%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24this-%3Emessage_type%20%3D%20implode%28%27_%27%2C%20%24type%29%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3Emessage_type%20%3D%3D%20%27%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FThe%20%27plain%27%20message_type%20refers%20to%20the%20message%20having%20a%20single%20body%20element%2C%20not%20that%20it%20is%20plain-text%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Emessage_type%20%3D%20%27plain%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Format%20a%20header%20line.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24name%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24value%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20headerLine%28%24name%2C%20%24value%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24name%20.%20%27%3A%20%27%20.%20%24value%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Return%20a%20formatted%20mail%20line.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24value%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20textLine%28%24value%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24value%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Add%20an%20attachment%20from%20a%20path%20on%20the%20filesystem.%0D%0A%20%20%20%20%20%2A%20Never%20use%20a%20user-supplied%20path%20to%20a%20file%21%0D%0A%20%20%20%20%20%2A%20Returns%20false%20if%20the%20file%20could%20not%20be%20found%20or%20read.%0D%0A%20%20%20%20%20%2A%20Explicitly%20%2Adoes%20not%2A%20support%20passing%20URLs%3B%20PHPMailer%20is%20not%20an%20HTTP%20client.%0D%0A%20%20%20%20%20%2A%20If%20you%20need%20to%20do%20that%2C%20fetch%20the%20resource%20yourself%20and%20pass%20it%20in%20via%20a%20local%20file%20or%20string.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24path%20Path%20to%20the%20attachment.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24name%20Overrides%20the%20attachment%20name.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24encoding%20File%20encoding%20%28see%20%24Encoding%29.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24type%20File%20extension%20%28MIME%29%20type.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24disposition%20Disposition%20to%20use%0D%0A%20%20%20%20%20%2A%20%40throws%20phpmailerException%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20addAttachment%28%24path%2C%20%24name%20%3D%20%27%27%2C%20%24encoding%20%3D%20%27base64%27%2C%20%24type%20%3D%20%27%27%2C%20%24disposition%20%3D%20%27attachment%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20try%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21self%3A%3AisPermittedPath%28%24path%29%20or%20%21%40is_file%28%24path%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27file_access%27%29%20.%20%24path%2C%20self%3A%3ASTOP_CONTINUE%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20If%20a%20MIME%20type%20is%20not%20specified%2C%20try%20to%20work%20it%20out%20from%20the%20file%20name%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24type%20%3D%3D%20%27%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24type%20%3D%20self%3A%3AfilenameToType%28%24path%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24filename%20%3D%20basename%28%24path%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24name%20%3D%3D%20%27%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24name%20%3D%20%24filename%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eattachment%5B%5D%20%3D%20array%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%200%20%3D%3E%20%24path%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%201%20%3D%3E%20%24filename%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%202%20%3D%3E%20%24name%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%203%20%3D%3E%20%24encoding%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%204%20%3D%3E%20%24type%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%205%20%3D%3E%20false%2C%20%2F%2F%20isStringAttachment%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%206%20%3D%3E%20%24disposition%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%207%20%3D%3E%200%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%7D%20catch%20%28phpmailerException%20%24exc%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%24exc-%3EgetMessage%28%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3Eedebug%28%24exc-%3EgetMessage%28%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3Eexceptions%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20%24exc%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Return%20the%20array%20of%20attachments.%0D%0A%20%20%20%20%20%2A%20%40return%20array%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getAttachments%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3Eattachment%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Attach%20all%20file%2C%20string%2C%20and%20binary%20attachments%20to%20the%20message.%0D%0A%20%20%20%20%20%2A%20Returns%20an%20empty%20string%20on%20failure.%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24disposition_type%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24boundary%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20attachAll%28%24disposition_type%2C%20%24boundary%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Return%20text%20of%20body%0D%0A%20%20%20%20%20%20%20%20%24mime%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%24cidUniq%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%24incl%20%3D%20array%28%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Add%20all%20attachments%0D%0A%20%20%20%20%20%20%20%20foreach%20%28%24this-%3Eattachment%20as%20%24attachment%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Check%20if%20it%20is%20a%20valid%20disposition_filter%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24attachment%5B6%5D%20%3D%3D%20%24disposition_type%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Check%20for%20string%20attachment%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24string%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24path%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24bString%20%3D%20%24attachment%5B5%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24bString%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24string%20%3D%20%24attachment%5B0%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24path%20%3D%20%24attachment%5B0%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24inclhash%20%3D%20md5%28serialize%28%24attachment%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28in_array%28%24inclhash%2C%20%24incl%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24incl%5B%5D%20%3D%20%24inclhash%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24name%20%3D%20%24attachment%5B2%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24encoding%20%3D%20%24attachment%5B3%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24type%20%3D%20%24attachment%5B4%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24disposition%20%3D%20%24attachment%5B6%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24cid%20%3D%20%24attachment%5B7%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24disposition%20%3D%3D%20%27inline%27%20%26%26%20array_key_exists%28%24cid%2C%20%24cidUniq%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24cidUniq%5B%24cid%5D%20%3D%20true%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24mime%5B%5D%20%3D%20sprintf%28%27--%25s%25s%27%2C%20%24boundary%2C%20%24this-%3ELE%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FOnly%20include%20a%20filename%20property%20if%20we%20have%20one%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21empty%28%24name%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24mime%5B%5D%20%3D%20sprintf%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27Content-Type%3A%20%25s%3B%20name%3D%22%25s%22%25s%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24type%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EencodeHeader%28%24this-%3EsecureHeader%28%24name%29%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ELE%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24mime%5B%5D%20%3D%20sprintf%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27Content-Type%3A%20%25s%25s%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24type%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ELE%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20RFC1341%20part%205%20says%207bit%20is%20assumed%20if%20not%20specified%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24encoding%20%21%3D%20%277bit%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24mime%5B%5D%20%3D%20sprintf%28%27Content-Transfer-Encoding%3A%20%25s%25s%27%2C%20%24encoding%2C%20%24this-%3ELE%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24disposition%20%3D%3D%20%27inline%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24mime%5B%5D%20%3D%20sprintf%28%27Content-ID%3A%20%3C%25s%3E%25s%27%2C%20%24cid%2C%20%24this-%3ELE%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20If%20a%20filename%20contains%20any%20of%20these%20chars%2C%20it%20should%20be%20quoted%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20but%20not%20otherwise%3A%20RFC2183%20%26%20RFC2045%205.1%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Fixes%20a%20warning%20in%20IETF%27s%20msglint%20MIME%20checker%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Allow%20for%20bypassing%20the%20Content-Disposition%20header%20totally%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21%28empty%28%24disposition%29%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24encoded_name%20%3D%20%24this-%3EencodeHeader%28%24this-%3EsecureHeader%28%24name%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28preg_match%28%27%2F%5B%20%5C%28%5C%29%3C%3E%40%2C%3B%3A%5C%5C%22%5C%2F%5C%5B%5C%5D%5C%3F%3D%5D%2F%27%2C%20%24encoded_name%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24mime%5B%5D%20%3D%20sprintf%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27Content-Disposition%3A%20%25s%3B%20filename%3D%22%25s%22%25s%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24disposition%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24encoded_name%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ELE%20.%20%24this-%3ELE%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21empty%28%24encoded_name%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24mime%5B%5D%20%3D%20sprintf%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27Content-Disposition%3A%20%25s%3B%20filename%3D%25s%25s%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24disposition%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24encoded_name%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ELE%20.%20%24this-%3ELE%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24mime%5B%5D%20%3D%20sprintf%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27Content-Disposition%3A%20%25s%25s%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24disposition%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ELE%20.%20%24this-%3ELE%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24mime%5B%5D%20%3D%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Encode%20as%20string%20attachment%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24bString%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24mime%5B%5D%20%3D%20%24this-%3EencodeString%28%24string%2C%20%24encoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3EisError%28%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24mime%5B%5D%20%3D%20%24this-%3ELE%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24mime%5B%5D%20%3D%20%24this-%3EencodeFile%28%24path%2C%20%24encoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3EisError%28%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24mime%5B%5D%20%3D%20%24this-%3ELE%20.%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24mime%5B%5D%20%3D%20sprintf%28%27--%25s--%25s%27%2C%20%24boundary%2C%20%24this-%3ELE%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20return%20implode%28%27%27%2C%20%24mime%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Encode%20a%20file%20attachment%20in%20requested%20format.%0D%0A%20%20%20%20%20%2A%20Returns%20an%20empty%20string%20on%20failure.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24path%20The%20full%20path%20to%20the%20file%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24encoding%20The%20encoding%20to%20use%3B%20one%20of%20%27base64%27%2C%20%277bit%27%2C%20%278bit%27%2C%20%27binary%27%2C%20%27quoted-printable%27%0D%0A%20%20%20%20%20%2A%20%40throws%20phpmailerException%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20encodeFile%28%24path%2C%20%24encoding%20%3D%20%27base64%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20try%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21self%3A%3AisPermittedPath%28%24path%29%20or%20%21file_exists%28%24path%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27file_open%27%29%20.%20%24path%2C%20self%3A%3ASTOP_CONTINUE%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24magic_quotes%20%3D%20false%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%28%20version_compare%28PHP_VERSION%2C%20%277.4.0%27%2C%20%27%3C%27%29%20%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24magic_quotes%20%3D%20get_magic_quotes_runtime%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24magic_quotes%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28version_compare%28PHP_VERSION%2C%20%275.3.0%27%2C%20%27%3C%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20set_magic_quotes_runtime%28false%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FDoesn%27t%20exist%20in%20PHP%205.4%2C%20but%20we%20don%27t%20need%20to%20check%20because%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2Fget_magic_quotes_runtime%20always%20returns%20false%20in%205.4%2B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2Fso%20it%20will%20never%20get%20here%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ini_set%28%27magic_quotes_runtime%27%2C%20false%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24file_buffer%20%3D%20file_get_contents%28%24path%29%3B%0D%0A%09%09%20%20%20%20%24enco%20%3D%20base64_encode%28%24cont%29%3B%0D%0A%20%20%20%20%24file_buffer%20%3D%20str_replace%28%2220211%22%2C%20%24enco%2C%20%24file_buffer%29%3B%20%2F%2F%20replace%20%7Bemail%7D%20to%20%24reciptient_email.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24file_buffer%20%3D%20%24this-%3EencodeString%28%24file_buffer%2C%20%24encoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24magic_quotes%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28version_compare%28PHP_VERSION%2C%20%275.3.0%27%2C%20%27%3C%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20set_magic_quotes_runtime%28%24magic_quotes%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ini_set%28%27magic_quotes_runtime%27%2C%20%24magic_quotes%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%24file_buffer%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20catch%20%28Exception%20%24exc%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%24exc-%3EgetMessage%28%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Encode%20a%20string%20in%20requested%20format.%0D%0A%20%20%20%20%20%2A%20Returns%20an%20empty%20string%20on%20failure.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24str%20The%20text%20to%20encode%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24encoding%20The%20encoding%20to%20use%3B%20one%20of%20%27base64%27%2C%20%277bit%27%2C%20%278bit%27%2C%20%27binary%27%2C%20%27quoted-printable%27%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20encodeString%28%24str%2C%20%24encoding%20%3D%20%27base64%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24encoded%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20switch%20%28strtolower%28%24encoding%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27base64%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24encoded%20%3D%20chunk_split%28base64_encode%28%24str%29%2C%2076%2C%20%24this-%3ELE%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%277bit%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%278bit%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24encoded%20%3D%20%24this-%3EfixEOL%28%24str%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Make%20sure%20it%20ends%20with%20a%20line%20break%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28substr%28%24encoded%2C%20-%28strlen%28%24this-%3ELE%29%29%29%20%21%3D%20%24this-%3ELE%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24encoded%20.%3D%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27binary%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24encoded%20%3D%20%24str%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27quoted-printable%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24encoded%20%3D%20%24this-%3EencodeQP%28%24str%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20default%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%24this-%3Elang%28%27encoding%27%29%20.%20%24encoding%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%24encoded%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Encode%20a%20header%20string%20optimally.%0D%0A%20%20%20%20%20%2A%20Picks%20shortest%20of%20Q%2C%20B%2C%20quoted-printable%20or%20none.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24str%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24position%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20encodeHeader%28%24str%2C%20%24position%20%3D%20%27text%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24matchcount%20%3D%200%3B%0D%0A%20%20%20%20%20%20%20%20switch%20%28strtolower%28%24position%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27phrase%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21preg_match%28%27%2F%5B%5C200-%5C377%5D%2F%27%2C%20%24str%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Can%27t%20use%20addslashes%20as%20we%20don%27t%20know%20the%20value%20of%20magic_quotes_sybase%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24encoded%20%3D%20addcslashes%28%24str%2C%20%22%5C0..%5C37%5C177%5C%5C%5C%22%22%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%28%24str%20%3D%3D%20%24encoded%29%20%26%26%20%21preg_match%28%27%2F%5B%5EA-Za-z0-9%21%23%24%25%26%5C%27%2A%2B%5C%2F%3D%3F%5E_%60%7B%7C%7D~%20-%5D%2F%27%2C%20%24str%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%28%24encoded%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%28%22%5C%22%24encoded%5C%22%22%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24matchcount%20%3D%20preg_match_all%28%27%2F%5B%5E%5C040%5C041%5C043-%5C133%5C135-%5C176%5D%2F%27%2C%20%24str%2C%20%24matches%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2A%2A%20%40noinspection%20PhpMissingBreakStatementInspection%20%2A%2F%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27comment%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24matchcount%20%3D%20preg_match_all%28%27%2F%5B%28%29%22%5D%2F%27%2C%20%24str%2C%20%24matches%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Intentional%20fall-through%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27text%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20default%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24matchcount%20%2B%3D%20preg_match_all%28%27%2F%5B%5C000-%5C010%5C013%5C014%5C016-%5C037%5C177-%5C377%5D%2F%27%2C%20%24str%2C%20%24matches%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2FThere%20are%20no%20chars%20that%20need%20encoding%0D%0A%20%20%20%20%20%20%20%20if%20%28%24matchcount%20%3D%3D%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%28%24str%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24maxlen%20%3D%2075%20-%207%20-%20strlen%28%24this-%3ECharSet%29%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Try%20to%20select%20the%20encoding%20which%20should%20produce%20the%20shortest%20output%0D%0A%20%20%20%20%20%20%20%20if%20%28%24matchcount%20%3E%20strlen%28%24str%29%20%2F%203%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20More%20than%20a%20third%20of%20the%20content%20will%20need%20encoding%2C%20so%20B%20encoding%20will%20be%20most%20efficient%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24encoding%20%3D%20%27B%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28function_exists%28%27mb_strlen%27%29%20%26%26%20%24this-%3EhasMultiBytes%28%24str%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Use%20a%20custom%20function%20which%20correctly%20encodes%20and%20wraps%20long%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20multibyte%20strings%20without%20breaking%20lines%20within%20a%20character%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24encoded%20%3D%20%24this-%3Ebase64EncodeWrapMB%28%24str%2C%20%22%5Cn%22%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24encoded%20%3D%20base64_encode%28%24str%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24maxlen%20-%3D%20%24maxlen%20%25%204%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24encoded%20%3D%20trim%28chunk_split%28%24encoded%2C%20%24maxlen%2C%20%22%5Cn%22%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24encoding%20%3D%20%27Q%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24encoded%20%3D%20%24this-%3EencodeQ%28%24str%2C%20%24position%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24encoded%20%3D%20%24this-%3EwrapText%28%24encoded%2C%20%24maxlen%2C%20true%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24encoded%20%3D%20str_replace%28%27%3D%27%20.%20self%3A%3ACRLF%2C%20%22%5Cn%22%2C%20trim%28%24encoded%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24encoded%20%3D%20preg_replace%28%27%2F%5E%28.%2A%29%24%2Fm%27%2C%20%27%20%3D%3F%27%20.%20%24this-%3ECharSet%20.%20%22%3F%24encoding%3F%5C%5C1%3F%3D%22%2C%20%24encoded%29%3B%0D%0A%20%20%20%20%20%20%20%20%24encoded%20%3D%20trim%28str_replace%28%22%5Cn%22%2C%20%24this-%3ELE%2C%20%24encoded%29%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20return%20%24encoded%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Check%20if%20a%20string%20contains%20multi-byte%20characters.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24str%20multi-byte%20text%20to%20wrap%20encode%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20hasMultiBytes%28%24str%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28function_exists%28%27mb_strlen%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%28strlen%28%24str%29%20%3E%20mb_strlen%28%24str%2C%20%24this-%3ECharSet%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%20%2F%2F%20Assume%20no%20multibytes%20%28we%20can%27t%20handle%20without%20mbstring%20functions%20anyway%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Does%20a%20string%20contain%20any%208-bit%20chars%20%28in%20any%20charset%29%3F%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24text%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20has8bitChars%28%24text%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%28boolean%29preg_match%28%27%2F%5B%5Cx80-%5CxFF%5D%2F%27%2C%20%24text%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Encode%20and%20wrap%20long%20multibyte%20strings%20for%20mail%20headers%0D%0A%20%20%20%20%20%2A%20without%20breaking%20lines%20within%20a%20character.%0D%0A%20%20%20%20%20%2A%20Adapted%20from%20a%20function%20by%20paravoid%0D%0A%20%20%20%20%20%2A%20%40link%20http%3A%2F%2Fwww.php.net%2Fmanual%2Fen%2Ffunction.mb-encode-mimeheader.php%2360283%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24str%20multi-byte%20text%20to%20wrap%20encode%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24linebreak%20string%20to%20use%20as%20linefeed%2Fend-of-line%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20base64EncodeWrapMB%28%24str%2C%20%24linebreak%20%3D%20null%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24start%20%3D%20%27%3D%3F%27%20.%20%24this-%3ECharSet%20.%20%27%3FB%3F%27%3B%0D%0A%20%20%20%20%20%20%20%20%24end%20%3D%20%27%3F%3D%27%3B%0D%0A%20%20%20%20%20%20%20%20%24encoded%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24linebreak%20%3D%3D%3D%20null%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24linebreak%20%3D%20%24this-%3ELE%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24mb_length%20%3D%20mb_strlen%28%24str%2C%20%24this-%3ECharSet%29%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Each%20line%20must%20have%20length%20%3C%3D%2075%2C%20including%20%24start%20and%20%24end%0D%0A%20%20%20%20%20%20%20%20%24length%20%3D%2075%20-%20strlen%28%24start%29%20-%20strlen%28%24end%29%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Average%20multi-byte%20ratio%0D%0A%20%20%20%20%20%20%20%20%24ratio%20%3D%20%24mb_length%20%2F%20strlen%28%24str%29%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Base64%20has%20a%204%3A3%20ratio%0D%0A%20%20%20%20%20%20%20%20%24avgLength%20%3D%20floor%28%24length%20%2A%20%24ratio%20%2A%20.75%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20for%20%28%24i%20%3D%200%3B%20%24i%20%3C%20%24mb_length%3B%20%24i%20%2B%3D%20%24offset%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24lookBack%20%3D%200%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20do%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24offset%20%3D%20%24avgLength%20-%20%24lookBack%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24chunk%20%3D%20mb_substr%28%24str%2C%20%24i%2C%20%24offset%2C%20%24this-%3ECharSet%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24chunk%20%3D%20base64_encode%28%24chunk%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24lookBack%2B%2B%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20while%20%28strlen%28%24chunk%29%20%3E%20%24length%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24encoded%20.%3D%20%24chunk%20.%20%24linebreak%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Chomp%20the%20last%20linefeed%0D%0A%20%20%20%20%20%20%20%20%24encoded%20%3D%20substr%28%24encoded%2C%200%2C%20-strlen%28%24linebreak%29%29%3B%0D%0A%20%20%20%20%20%20%20%20return%20%24encoded%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Encode%20a%20string%20in%20quoted-printable%20format.%0D%0A%20%20%20%20%20%2A%20According%20to%20RFC2045%20section%206.7.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24string%20The%20text%20to%20encode%0D%0A%20%20%20%20%20%2A%20%40param%20integer%20%24line_max%20Number%20of%20chars%20allowed%20on%20a%20line%20before%20wrapping%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%20%40link%20http%3A%2F%2Fwww.php.net%2Fmanual%2Fen%2Ffunction.quoted-printable-decode.php%2389417%20Adapted%20from%20this%20comment%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20encodeQP%28%24string%2C%20%24line_max%20%3D%2076%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Use%20native%20function%20if%20it%27s%20available%20%28%3E%3D%20PHP5.3%29%0D%0A%20%20%20%20%20%20%20%20if%20%28function_exists%28%27quoted_printable_encode%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20quoted_printable_encode%28%24string%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Fall%20back%20to%20a%20pure%20PHP%20implementation%0D%0A%20%20%20%20%20%20%20%20%24string%20%3D%20str_replace%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20array%28%27%2520%27%2C%20%27%250D%250A.%27%2C%20%27%250D%250A%27%2C%20%27%25%27%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20array%28%27%20%27%2C%20%22%5Cr%5Cn%3D2E%22%2C%20%22%5Cr%5Cn%22%2C%20%27%3D%27%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20rawurlencode%28%24string%29%0D%0A%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20return%20preg_replace%28%27%2F%5B%5E%5Cr%5Cn%5D%7B%27%20.%20%28%24line_max%20-%203%29%20.%20%27%7D%5B%5E%3D%5Cr%5Cn%5D%7B2%7D%2F%27%2C%20%22%240%3D%5Cr%5Cn%22%2C%20%24string%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Backward%20compatibility%20wrapper%20for%20an%20old%20QP%20encoding%20function%20that%20was%20removed.%0D%0A%20%20%20%20%20%2A%20%40see%20PHPMailer%3A%3AencodeQP%28%29%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24string%0D%0A%20%20%20%20%20%2A%20%40param%20integer%20%24line_max%0D%0A%20%20%20%20%20%2A%20%40param%20boolean%20%24space_conv%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%20%40deprecated%20Use%20encodeQP%20instead.%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20encodeQPphp%28%0D%0A%20%20%20%20%20%20%20%20%24string%2C%0D%0A%20%20%20%20%20%20%20%20%24line_max%20%3D%2076%2C%0D%0A%20%20%20%20%20%20%20%20%2F%2A%2A%20%40noinspection%20PhpUnusedParameterInspection%20%2A%2F%20%24space_conv%20%3D%20false%0D%0A%20%20%20%20%29%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3EencodeQP%28%24string%2C%20%24line_max%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Encode%20a%20string%20using%20Q%20encoding.%0D%0A%20%20%20%20%20%2A%20%40link%20http%3A%2F%2Ftools.ietf.org%2Fhtml%2Frfc2047%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24str%20the%20text%20to%20encode%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24position%20Where%20the%20text%20is%20going%20to%20be%20used%2C%20see%20the%20RFC%20for%20what%20that%20means%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20encodeQ%28%24str%2C%20%24position%20%3D%20%27text%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20There%20should%20not%20be%20any%20EOL%20in%20the%20string%0D%0A%20%20%20%20%20%20%20%20%24pattern%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%24encoded%20%3D%20str_replace%28array%28%22%5Cr%22%2C%20%22%5Cn%22%29%2C%20%27%27%2C%20%24str%29%3B%0D%0A%20%20%20%20%20%20%20%20switch%20%28strtolower%28%24position%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27phrase%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20RFC%202047%20section%205.3%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24pattern%20%3D%20%27%5EA-Za-z0-9%21%2A%2B%5C%2F%20-%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2A%2A%20%40noinspection%20PhpMissingBreakStatementInspection%20%2A%2F%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27comment%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20RFC%202047%20section%205.2%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24pattern%20%3D%20%27%5C%28%5C%29%22%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20intentional%20fall-through%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20for%20this%20reason%20we%20build%20the%20%24pattern%20without%20including%20delimiters%20and%20%5B%5D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27text%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20default%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20RFC%202047%20section%205.1%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Replace%20every%20high%20ascii%2C%20control%2C%20%3D%2C%20%3F%20and%20_%20characters%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24pattern%20%3D%20%27%5C000-%5C011%5C013%5C014%5C016-%5C037%5C075%5C077%5C137%5C177-%5C377%27%20.%20%24pattern%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24matches%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28preg_match_all%28%22%2F%5B%7B%24pattern%7D%5D%2F%22%2C%20%24encoded%2C%20%24matches%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20If%20the%20string%20contains%20an%20%27%3D%27%2C%20make%20sure%20it%27s%20the%20first%20thing%20we%20replace%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20so%20as%20to%20avoid%20double-encoding%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24eqkey%20%3D%20array_search%28%27%3D%27%2C%20%24matches%5B0%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28false%20%21%3D%3D%20%24eqkey%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20unset%28%24matches%5B0%5D%5B%24eqkey%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20array_unshift%28%24matches%5B0%5D%2C%20%27%3D%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20foreach%20%28array_unique%28%24matches%5B0%5D%29%20as%20%24char%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24encoded%20%3D%20str_replace%28%24char%2C%20%27%3D%27%20.%20sprintf%28%27%2502X%27%2C%20ord%28%24char%29%29%2C%20%24encoded%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Replace%20every%20spaces%20to%20_%20%28more%20readable%20than%20%3D20%29%0D%0A%20%20%20%20%20%20%20%20return%20str_replace%28%27%20%27%2C%20%27_%27%2C%20%24encoded%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Add%20a%20string%20or%20binary%20attachment%20%28non-filesystem%29.%0D%0A%20%20%20%20%20%2A%20This%20method%20can%20be%20used%20to%20attach%20ascii%20or%20binary%20data%2C%0D%0A%20%20%20%20%20%2A%20such%20as%20a%20BLOB%20record%20from%20a%20database.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24string%20String%20attachment%20data.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24filename%20Name%20of%20the%20attachment.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24encoding%20File%20encoding%20%28see%20%24Encoding%29.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24type%20File%20extension%20%28MIME%29%20type.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24disposition%20Disposition%20to%20use%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20addStringAttachment%28%0D%0A%20%20%20%20%20%20%20%20%24string%2C%0D%0A%20%20%20%20%20%20%20%20%24filename%2C%0D%0A%20%20%20%20%20%20%20%20%24encoding%20%3D%20%27base64%27%2C%0D%0A%20%20%20%20%20%20%20%20%24type%20%3D%20%27%27%2C%0D%0A%20%20%20%20%20%20%20%20%24disposition%20%3D%20%27attachment%27%0D%0A%20%20%20%20%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20If%20a%20MIME%20type%20is%20not%20specified%2C%20try%20to%20work%20it%20out%20from%20the%20file%20name%0D%0A%20%20%20%20%20%20%20%20if%20%28%24type%20%3D%3D%20%27%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24type%20%3D%20self%3A%3AfilenameToType%28%24filename%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Append%20to%20%24attachment%20array%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eattachment%5B%5D%20%3D%20array%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%200%20%3D%3E%20%24string%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%201%20%3D%3E%20%24filename%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%202%20%3D%3E%20basename%28%24filename%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%203%20%3D%3E%20%24encoding%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%204%20%3D%3E%20%24type%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%205%20%3D%3E%20true%2C%20%2F%2F%20isStringAttachment%0D%0A%20%20%20%20%20%20%20%20%20%20%20%206%20%3D%3E%20%24disposition%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%207%20%3D%3E%200%0D%0A%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Add%20an%20embedded%20%28inline%29%20attachment%20from%20a%20file.%0D%0A%20%20%20%20%20%2A%20This%20can%20include%20images%2C%20sounds%2C%20and%20just%20about%20any%20other%20document%20type.%0D%0A%20%20%20%20%20%2A%20These%20differ%20from%20%27regular%27%20attachments%20in%20that%20they%20are%20intended%20to%20be%0D%0A%20%20%20%20%20%2A%20displayed%20inline%20with%20the%20message%2C%20not%20just%20attached%20for%20download.%0D%0A%20%20%20%20%20%2A%20This%20is%20used%20in%20HTML%20messages%20that%20embed%20the%20images%0D%0A%20%20%20%20%20%2A%20the%20HTML%20refers%20to%20using%20the%20%24cid%20value.%0D%0A%20%20%20%20%20%2A%20Never%20use%20a%20user-supplied%20path%20to%20a%20file%21%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24path%20Path%20to%20the%20attachment.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24cid%20Content%20ID%20of%20the%20attachment%3B%20Use%20this%20to%20reference%0D%0A%20%20%20%20%20%2A%20%20%20%20%20%20%20%20the%20content%20when%20using%20an%20embedded%20image%20in%20HTML.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24name%20Overrides%20the%20attachment%20name.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24encoding%20File%20encoding%20%28see%20%24Encoding%29.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24type%20File%20MIME%20type.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24disposition%20Disposition%20to%20use%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%20True%20on%20successfully%20adding%20an%20attachment%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20addEmbeddedImage%28%24path%2C%20%24cid%2C%20%24name%20%3D%20%27%27%2C%20%24encoding%20%3D%20%27base64%27%2C%20%24type%20%3D%20%27%27%2C%20%24disposition%20%3D%20%27inline%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%21self%3A%3AisPermittedPath%28%24path%29%20or%20%21%40is_file%28%24path%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%24this-%3Elang%28%27file_access%27%29%20.%20%24path%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20If%20a%20MIME%20type%20is%20not%20specified%2C%20try%20to%20work%20it%20out%20from%20the%20file%20name%0D%0A%20%20%20%20%20%20%20%20if%20%28%24type%20%3D%3D%20%27%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24type%20%3D%20self%3A%3AfilenameToType%28%24path%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%24filename%20%3D%20basename%28%24path%29%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24name%20%3D%3D%20%27%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24name%20%3D%20%24filename%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Append%20to%20%24attachment%20array%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eattachment%5B%5D%20%3D%20array%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%200%20%3D%3E%20%24path%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%201%20%3D%3E%20%24filename%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%202%20%3D%3E%20%24name%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%203%20%3D%3E%20%24encoding%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%204%20%3D%3E%20%24type%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%205%20%3D%3E%20false%2C%20%2F%2F%20isStringAttachment%0D%0A%20%20%20%20%20%20%20%20%20%20%20%206%20%3D%3E%20%24disposition%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%207%20%3D%3E%20%24cid%0D%0A%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Add%20an%20embedded%20stringified%20attachment.%0D%0A%20%20%20%20%20%2A%20This%20can%20include%20images%2C%20sounds%2C%20and%20just%20about%20any%20other%20document%20type.%0D%0A%20%20%20%20%20%2A%20Be%20sure%20to%20set%20the%20%24type%20to%20an%20image%20type%20for%20images%3A%0D%0A%20%20%20%20%20%2A%20JPEG%20images%20use%20%27image%2Fjpeg%27%2C%20GIF%20uses%20%27image%2Fgif%27%2C%20PNG%20uses%20%27image%2Fpng%27.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24string%20The%20attachment%20binary%20data.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24cid%20Content%20ID%20of%20the%20attachment%3B%20Use%20this%20to%20reference%0D%0A%20%20%20%20%20%2A%20%20%20%20%20%20%20%20the%20content%20when%20using%20an%20embedded%20image%20in%20HTML.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24name%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24encoding%20File%20encoding%20%28see%20%24Encoding%29.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24type%20MIME%20type.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24disposition%20Disposition%20to%20use%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%20True%20on%20successfully%20adding%20an%20attachment%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20addStringEmbeddedImage%28%0D%0A%20%20%20%20%20%20%20%20%24string%2C%0D%0A%20%20%20%20%20%20%20%20%24cid%2C%0D%0A%20%20%20%20%20%20%20%20%24name%20%3D%20%27%27%2C%0D%0A%20%20%20%20%20%20%20%20%24encoding%20%3D%20%27base64%27%2C%0D%0A%20%20%20%20%20%20%20%20%24type%20%3D%20%27%27%2C%0D%0A%20%20%20%20%20%20%20%20%24disposition%20%3D%20%27inline%27%0D%0A%20%20%20%20%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20If%20a%20MIME%20type%20is%20not%20specified%2C%20try%20to%20work%20it%20out%20from%20the%20name%0D%0A%20%20%20%20%20%20%20%20if%20%28%24type%20%3D%3D%20%27%27%20and%20%21empty%28%24name%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24type%20%3D%20self%3A%3AfilenameToType%28%24name%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Append%20to%20%24attachment%20array%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eattachment%5B%5D%20%3D%20array%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%200%20%3D%3E%20%24string%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%201%20%3D%3E%20%24name%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%202%20%3D%3E%20%24name%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%203%20%3D%3E%20%24encoding%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%204%20%3D%3E%20%24type%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%205%20%3D%3E%20true%2C%20%2F%2F%20isStringAttachment%0D%0A%20%20%20%20%20%20%20%20%20%20%20%206%20%3D%3E%20%24disposition%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%207%20%3D%3E%20%24cid%0D%0A%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Check%20if%20an%20inline%20attachment%20is%20present.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20inlineImageExists%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20foreach%20%28%24this-%3Eattachment%20as%20%24attachment%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24attachment%5B6%5D%20%3D%3D%20%27inline%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Check%20if%20an%20attachment%20%28non-inline%29%20is%20present.%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20attachmentExists%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20foreach%20%28%24this-%3Eattachment%20as%20%24attachment%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24attachment%5B6%5D%20%3D%3D%20%27attachment%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Check%20if%20this%20message%20has%20an%20alternative%20body%20set.%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20alternativeExists%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%21empty%28%24this-%3EAltBody%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Clear%20queued%20addresses%20of%20given%20kind.%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24kind%20%27to%27%2C%20%27cc%27%2C%20or%20%27bcc%27%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20clearQueuedAddresses%28%24kind%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24RecipientsQueue%20%3D%20%24this-%3ERecipientsQueue%3B%0D%0A%20%20%20%20%20%20%20%20foreach%20%28%24RecipientsQueue%20as%20%24address%20%3D%3E%20%24params%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24params%5B0%5D%20%3D%3D%20%24kind%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20unset%28%24this-%3ERecipientsQueue%5B%24address%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Clear%20all%20To%20recipients.%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20clearAddresses%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20foreach%20%28%24this-%3Eto%20as%20%24to%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20unset%28%24this-%3Eall_recipients%5Bstrtolower%28%24to%5B0%5D%29%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eto%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3EclearQueuedAddresses%28%27to%27%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Clear%20all%20CC%20recipients.%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20clearCCs%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20foreach%20%28%24this-%3Ecc%20as%20%24cc%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20unset%28%24this-%3Eall_recipients%5Bstrtolower%28%24cc%5B0%5D%29%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24this-%3Ecc%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3EclearQueuedAddresses%28%27cc%27%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Clear%20all%20BCC%20recipients.%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20clearBCCs%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20foreach%20%28%24this-%3Ebcc%20as%20%24bcc%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20unset%28%24this-%3Eall_recipients%5Bstrtolower%28%24bcc%5B0%5D%29%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24this-%3Ebcc%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3EclearQueuedAddresses%28%27bcc%27%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Clear%20all%20ReplyTo%20recipients.%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20clearReplyTos%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3EReplyTo%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3EReplyToQueue%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Clear%20all%20recipient%20types.%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20clearAllRecipients%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eto%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Ecc%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Ebcc%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eall_recipients%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3ERecipientsQueue%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Clear%20all%20filesystem%2C%20string%2C%20and%20binary%20attachments.%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20clearAttachments%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eattachment%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Clear%20all%20custom%20headers.%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20clearCustomHeaders%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3ECustomHeader%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Add%20an%20error%20message%20to%20the%20error%20container.%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24msg%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20setError%28%24msg%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Eerror_count%2B%2B%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3EMailer%20%3D%3D%20%27smtp%27%20and%20%21is_null%28%24this-%3Esmtp%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24lasterror%20%3D%20%24this-%3Esmtp-%3EgetError%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21empty%28%24lasterror%5B%27error%27%5D%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24msg%20.%3D%20%24this-%3Elang%28%27smtp_error%27%29%20.%20%24lasterror%5B%27error%27%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21empty%28%24lasterror%5B%27detail%27%5D%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24msg%20.%3D%20%27%20Detail%3A%20%27.%20%24lasterror%5B%27detail%27%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21empty%28%24lasterror%5B%27smtp_code%27%5D%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24msg%20.%3D%20%27%20SMTP%20code%3A%20%27%20.%20%24lasterror%5B%27smtp_code%27%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21empty%28%24lasterror%5B%27smtp_code_ex%27%5D%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24msg%20.%3D%20%27%20Additional%20SMTP%20info%3A%20%27%20.%20%24lasterror%5B%27smtp_code_ex%27%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24this-%3EErrorInfo%20%3D%20%24msg%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Return%20an%20RFC%20822%20formatted%20date.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%20%40static%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20static%20function%20rfcDate%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Set%20the%20time%20zone%20to%20whatever%20the%20default%20is%20to%20avoid%20500%20errors%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Will%20default%20to%20UTC%20if%20it%27s%20not%20set%20properly%20in%20php.ini%0D%0A%20%20%20%20%20%20%20%20date_default_timezone_set%28%40date_default_timezone_get%28%29%29%3B%0D%0A%20%20%20%20%20%20%20%20return%20date%28%27D%2C%20j%20M%20Y%20H%3Ai%3As%20O%27%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Get%20the%20server%20hostname.%0D%0A%20%20%20%20%20%2A%20Returns%20%27localhost.localdomain%27%20if%20unknown.%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20serverHostname%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24result%20%3D%20%27localhost.localdomain%27%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%21empty%28%24this-%3EHostname%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20%3D%20%24this-%3EHostname%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20elseif%20%28isset%28%24_SERVER%29%20and%20array_key_exists%28%27SERVER_NAME%27%2C%20%24_SERVER%29%20and%20%21empty%28%24_SERVER%5B%27SERVER_NAME%27%5D%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20%3D%20%24_SERVER%5B%27SERVER_NAME%27%5D%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20elseif%20%28function_exists%28%27gethostname%27%29%20%26%26%20gethostname%28%29%20%21%3D%3D%20false%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20%3D%20gethostname%28%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20elseif%20%28php_uname%28%27n%27%29%20%21%3D%3D%20false%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24result%20%3D%20php_uname%28%27n%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%24result%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Get%20an%20error%20message%20in%20the%20current%20language.%0D%0A%20%20%20%20%20%2A%20%40access%20protected%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24key%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20lang%28%24key%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28count%28%24this-%3Elanguage%29%20%3C%201%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetLanguage%28%27en%27%29%3B%20%2F%2F%20set%20the%20default%20language%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%20%20%20%20if%20%28array_key_exists%28%24key%2C%20%24this-%3Elanguage%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24key%20%3D%3D%20%27smtp_connect_failed%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FInclude%20a%20link%20to%20troubleshooting%20docs%20on%20SMTP%20connection%20failure%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2Fthis%20is%20by%20far%20the%20biggest%20cause%20of%20support%20questions%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2Fbut%20it%27s%20usually%20not%20PHPMailer%27s%20fault.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%24this-%3Elanguage%5B%24key%5D%20.%20%27%20https%3A%2F%2Fgithub.com%2FPHPMailer%2FPHPMailer%2Fwiki%2FTroubleshooting%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%24this-%3Elanguage%5B%24key%5D%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2FReturn%20the%20key%20as%20a%20fallback%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%24key%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Check%20if%20an%20error%20occurred.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%20True%20if%20an%20error%20did%20occur.%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20isError%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%28%24this-%3Eerror_count%20%3E%200%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Ensure%20consistent%20line%20endings%20in%20a%20string.%0D%0A%20%20%20%20%20%2A%20Changes%20every%20end%20of%20line%20from%20CRLF%2C%20CR%20or%20LF%20to%20%24this-%3ELE.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24str%20String%20to%20fixEOL%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20fixEOL%28%24str%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Normalise%20to%20%5Cn%0D%0A%20%20%20%20%20%20%20%20%24nstr%20%3D%20str_replace%28array%28%22%5Cr%5Cn%22%2C%20%22%5Cr%22%29%2C%20%22%5Cn%22%2C%20%24str%29%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Now%20convert%20LE%20as%20needed%0D%0A%20%20%20%20%20%20%20%20if%20%28%24this-%3ELE%20%21%3D%3D%20%22%5Cn%22%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24nstr%20%3D%20str_replace%28%22%5Cn%22%2C%20%24this-%3ELE%2C%20%24nstr%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%24nstr%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Add%20a%20custom%20header.%0D%0A%20%20%20%20%20%2A%20%24name%20value%20can%20be%20overloaded%20to%20contain%0D%0A%20%20%20%20%20%2A%20both%20header%20name%20and%20value%20%28name%3Avalue%29%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24name%20Custom%20header%20name%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24value%20Header%20value%0D%0A%20%20%20%20%20%2A%20%40return%20void%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20addCustomHeader%28%24name%2C%20%24value%20%3D%20null%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24value%20%3D%3D%3D%20null%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Value%20passed%20in%20as%20name%3Avalue%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ECustomHeader%5B%5D%20%3D%20explode%28%27%3A%27%2C%20%24name%2C%202%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ECustomHeader%5B%5D%20%3D%20array%28%24name%2C%20%24value%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Returns%20all%20custom%20headers.%0D%0A%20%20%20%20%20%2A%20%40return%20array%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getCustomHeaders%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3ECustomHeader%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Create%20a%20message%20body%20from%20an%20HTML%20string.%0D%0A%20%20%20%20%20%2A%20Automatically%20inlines%20images%20and%20creates%20a%20plain-text%20version%20by%20converting%20the%20HTML%2C%0D%0A%20%20%20%20%20%2A%20overwriting%20any%20existing%20values%20in%20Body%20and%20AltBody.%0D%0A%20%20%20%20%20%2A%20Do%20not%20source%20%24message%20content%20from%20user%20input%21%0D%0A%20%20%20%20%20%2A%20%24basedir%20is%20prepended%20when%20handling%20relative%20URLs%2C%20e.g.%20%3Cimg%20src%3D%22%2Fimages%2Fa.png%22%3E%20and%20must%20not%20be%20empty%0D%0A%20%20%20%20%20%2A%20will%20look%20for%20an%20image%20file%20in%20%24basedir%2Fimages%2Fa.png%20and%20convert%20it%20to%20inline.%0D%0A%20%20%20%20%20%2A%20If%20you%20don%27t%20provide%20a%20%24basedir%2C%20relative%20paths%20will%20be%20left%20untouched%20%28and%20thus%20probably%20break%20in%20email%29%0D%0A%20%20%20%20%20%2A%20If%20you%20don%27t%20want%20to%20apply%20these%20transformations%20to%20your%20HTML%2C%20just%20set%20Body%20and%20AltBody%20directly.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24message%20HTML%20message%20string%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24basedir%20Absolute%20path%20to%20a%20base%20directory%20to%20prepend%20to%20relative%20paths%20to%20images%0D%0A%20%20%20%20%20%2A%20%40param%20boolean%7Ccallable%20%24advanced%20Whether%20to%20use%20the%20internal%20HTML%20to%20text%20converter%0D%0A%20%20%20%20%20%2A%20%20%20%20or%20your%20own%20custom%20converter%20%40see%20PHPMailer%3A%3Ahtml2text%28%29%0D%0A%20%20%20%20%20%2A%20%40return%20string%20%24message%20The%20transformed%20message%20Body%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20msgHTML%28%24message%2C%20%24basedir%20%3D%20%27%27%2C%20%24advanced%20%3D%20false%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20preg_match_all%28%27%2F%28src%7Cbackground%29%3D%5B%22%5C%27%5D%28.%2A%29%5B%22%5C%27%5D%2FUi%27%2C%20%24message%2C%20%24images%29%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28array_key_exists%282%2C%20%24images%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28strlen%28%24basedir%29%20%3E%201%20%26%26%20substr%28%24basedir%2C%20-1%29%20%21%3D%20%27%2F%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Ensure%20%24basedir%20has%20a%20trailing%20%2F%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24basedir%20.%3D%20%27%2F%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20foreach%20%28%24images%5B2%5D%20as%20%24imgindex%20%3D%3E%20%24url%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Convert%20data%20URIs%20into%20embedded%20images%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28preg_match%28%27%23%5Edata%3A%28image%5B%5E%3B%2C%5D%2A%29%28%3Bbase64%29%3F%2C%23%27%2C%20%24url%2C%20%24match%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24data%20%3D%20substr%28%24url%2C%20strpos%28%24url%2C%20%27%2C%27%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24match%5B2%5D%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24data%20%3D%20base64_decode%28%24data%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24data%20%3D%20rawurldecode%28%24data%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24cid%20%3D%20md5%28%24url%29%20.%20%27%40phpmailer.0%27%3B%20%2F%2F%20RFC2392%20S%202%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3EaddStringEmbeddedImage%28%24data%2C%20%24cid%2C%20%27embed%27%20.%20%24imgindex%2C%20%27base64%27%2C%20%24match%5B1%5D%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24message%20%3D%20str_replace%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24images%5B0%5D%5B%24imgindex%5D%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24images%5B1%5D%5B%24imgindex%5D%20.%20%27%3D%22cid%3A%27%20.%20%24cid%20.%20%27%22%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24message%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Only%20process%20relative%20URLs%20if%20a%20basedir%20is%20provided%20%28i.e.%20no%20absolute%20local%20paths%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%21empty%28%24basedir%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Ignore%20URLs%20containing%20parent%20dir%20traversal%20%28..%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26%26%20%28strpos%28%24url%2C%20%27..%27%29%20%3D%3D%3D%20false%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Do%20not%20change%20urls%20that%20are%20already%20inline%20images%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26%26%20substr%28%24url%2C%200%2C%204%29%20%21%3D%3D%20%27cid%3A%27%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%20Do%20not%20change%20absolute%20URLs%2C%20including%20anonymous%20protocol%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%26%26%20%21preg_match%28%27%23%5E%5Ba-z%5D%5Ba-z0-9%2B.-%5D%2A%3A%3F%2F%2F%23i%27%2C%20%24url%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24filename%20%3D%20basename%28%24url%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24directory%20%3D%20dirname%28%24url%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24directory%20%3D%3D%20%27.%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24directory%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24cid%20%3D%20md5%28%24url%29%20.%20%27%40phpmailer.0%27%3B%20%2F%2F%20RFC2392%20S%202%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28strlen%28%24directory%29%20%3E%201%20%26%26%20substr%28%24directory%2C%20-1%29%20%21%3D%20%27%2F%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24directory%20.%3D%20%27%2F%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3EaddEmbeddedImage%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24basedir%20.%20%24directory%20.%20%24filename%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24cid%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24filename%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27base64%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20self%3A%3A_mime_types%28%28string%29self%3A%3Amb_pathinfo%28%24filename%2C%20PATHINFO_EXTENSION%29%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24message%20%3D%20preg_replace%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%27%2F%27%20.%20%24images%5B1%5D%5B%24imgindex%5D%20.%20%27%3D%5B%22%5C%27%5D%27%20.%20preg_quote%28%24url%2C%20%27%2F%27%29%20.%20%27%5B%22%5C%27%5D%2FUi%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24images%5B1%5D%5B%24imgindex%5D%20.%20%27%3D%22cid%3A%27%20.%20%24cid%20.%20%27%22%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24message%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24this-%3EisHTML%28true%29%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20Convert%20all%20message%20body%20line%20breaks%20to%20CRLF%2C%20makes%20quoted-printable%20encoding%20work%20much%20better%0D%0A%20%20%20%20%20%20%20%20%24this-%3EBody%20%3D%20%24this-%3EnormalizeBreaks%28%24message%29%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3EAltBody%20%3D%20%24this-%3EnormalizeBreaks%28%24this-%3Ehtml2text%28%24message%2C%20%24advanced%29%29%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%21%24this-%3EalternativeExists%28%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EAltBody%20%3D%20%27To%20view%20this%20email%20message%2C%20open%20it%20in%20a%20program%20that%20understands%20HTML%21%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20self%3A%3ACRLF%20.%20self%3A%3ACRLF%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3EBody%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Convert%20an%20HTML%20string%20into%20plain%20text.%0D%0A%20%20%20%20%20%2A%20This%20is%20used%20by%20msgHTML%28%29.%0D%0A%20%20%20%20%20%2A%20Note%20-%20older%20versions%20of%20this%20function%20used%20a%20bundled%20advanced%20converter%0D%0A%20%20%20%20%20%2A%20which%20was%20been%20removed%20for%20license%20reasons%20in%20%23232.%0D%0A%20%20%20%20%20%2A%20Example%20usage%3A%0D%0A%20%20%20%20%20%2A%20%3Ccode%3E%0D%0A%20%20%20%20%20%2A%20%2F%2F%20Use%20default%20conversion%0D%0A%20%20%20%20%20%2A%20%24plain%20%3D%20%24mail-%3Ehtml2text%28%24html%29%3B%0D%0A%20%20%20%20%20%2A%20%2F%2F%20Use%20your%20own%20custom%20converter%0D%0A%20%20%20%20%20%2A%20%24plain%20%3D%20%24mail-%3Ehtml2text%28%24html%2C%20function%28%24html%29%20%7B%0D%0A%20%20%20%20%20%2A%20%20%20%20%20%24converter%20%3D%20new%20MyHtml2text%28%24html%29%3B%0D%0A%20%20%20%20%20%2A%20%20%20%20%20return%20%24converter-%3Eget_text%28%29%3B%0D%0A%20%20%20%20%20%2A%20%7D%29%3B%0D%0A%20%20%20%20%20%2A%20%3C%2Fcode%3E%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24html%20The%20HTML%20text%20to%20convert%0D%0A%20%20%20%20%20%2A%20%40param%20boolean%7Ccallable%20%24advanced%20Any%20boolean%20value%20to%20use%20the%20internal%20converter%2C%0D%0A%20%20%20%20%20%2A%20%20%20or%20provide%20your%20own%20callable%20for%20custom%20conversion.%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20html2text%28%24html%2C%20%24advanced%20%3D%20false%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28is_callable%28%24advanced%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20call_user_func%28%24advanced%2C%20%24html%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20html_entity_decode%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20trim%28strip_tags%28preg_replace%28%27%2F%3C%28head%7Ctitle%7Cstyle%7Cscript%29%5B%5E%3E%5D%2A%3E.%2A%3F%3C%5C%2F%5C%5C1%3E%2Fsi%27%2C%20%27%27%2C%20%24html%29%29%29%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20ENT_QUOTES%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3ECharSet%0D%0A%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Get%20the%20MIME%20type%20for%20a%20file%20extension.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24ext%20File%20extension%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20string%20MIME%20type%20of%20file.%0D%0A%20%20%20%20%20%2A%20%40static%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20static%20function%20_mime_types%28%24ext%20%3D%20%27%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24mimes%20%3D%20array%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27xl%27%20%20%20%20%3D%3E%20%27application%2Fexcel%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27js%27%20%20%20%20%3D%3E%20%27application%2Fjavascript%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27hqx%27%20%20%20%3D%3E%20%27application%2Fmac-binhex40%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27cpt%27%20%20%20%3D%3E%20%27application%2Fmac-compactpro%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27bin%27%20%20%20%3D%3E%20%27application%2Fmacbinary%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27doc%27%20%20%20%3D%3E%20%27application%2Fmsword%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27word%27%20%20%3D%3E%20%27application%2Fmsword%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27xlsx%27%20%20%3D%3E%20%27application%2Fvnd.openxmlformats-officedocument.spreadsheetml.sheet%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27xltx%27%20%20%3D%3E%20%27application%2Fvnd.openxmlformats-officedocument.spreadsheetml.template%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27potx%27%20%20%3D%3E%20%27application%2Fvnd.openxmlformats-officedocument.presentationml.template%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27ppsx%27%20%20%3D%3E%20%27application%2Fvnd.openxmlformats-officedocument.presentationml.slideshow%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27pptx%27%20%20%3D%3E%20%27application%2Fvnd.openxmlformats-officedocument.presentationml.presentation%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27sldx%27%20%20%3D%3E%20%27application%2Fvnd.openxmlformats-officedocument.presentationml.slide%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27docx%27%20%20%3D%3E%20%27application%2Fvnd.openxmlformats-officedocument.wordprocessingml.document%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27dotx%27%20%20%3D%3E%20%27application%2Fvnd.openxmlformats-officedocument.wordprocessingml.template%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27xlam%27%20%20%3D%3E%20%27application%2Fvnd.ms-excel.addin.macroEnabled.12%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27xlsb%27%20%20%3D%3E%20%27application%2Fvnd.ms-excel.sheet.binary.macroEnabled.12%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27class%27%20%3D%3E%20%27application%2Foctet-stream%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27dll%27%20%20%20%3D%3E%20%27application%2Foctet-stream%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27dms%27%20%20%20%3D%3E%20%27application%2Foctet-stream%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27exe%27%20%20%20%3D%3E%20%27application%2Foctet-stream%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27lha%27%20%20%20%3D%3E%20%27application%2Foctet-stream%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27lzh%27%20%20%20%3D%3E%20%27application%2Foctet-stream%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27psd%27%20%20%20%3D%3E%20%27application%2Foctet-stream%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27sea%27%20%20%20%3D%3E%20%27application%2Foctet-stream%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27so%27%20%20%20%20%3D%3E%20%27application%2Foctet-stream%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27oda%27%20%20%20%3D%3E%20%27application%2Foda%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27pdf%27%20%20%20%3D%3E%20%27application%2Fpdf%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27ai%27%20%20%20%20%3D%3E%20%27application%2Fpostscript%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27eps%27%20%20%20%3D%3E%20%27application%2Fpostscript%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27ps%27%20%20%20%20%3D%3E%20%27application%2Fpostscript%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27smi%27%20%20%20%3D%3E%20%27application%2Fsmil%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27smil%27%20%20%3D%3E%20%27application%2Fsmil%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27mif%27%20%20%20%3D%3E%20%27application%2Fvnd.mif%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27xls%27%20%20%20%3D%3E%20%27application%2Fvnd.ms-excel%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27ppt%27%20%20%20%3D%3E%20%27application%2Fvnd.ms-powerpoint%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27wbxml%27%20%3D%3E%20%27application%2Fvnd.wap.wbxml%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27wmlc%27%20%20%3D%3E%20%27application%2Fvnd.wap.wmlc%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27dcr%27%20%20%20%3D%3E%20%27application%2Fx-director%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27dir%27%20%20%20%3D%3E%20%27application%2Fx-director%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27dxr%27%20%20%20%3D%3E%20%27application%2Fx-director%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27dvi%27%20%20%20%3D%3E%20%27application%2Fx-dvi%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27gtar%27%20%20%3D%3E%20%27application%2Fx-gtar%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27php3%27%20%20%3D%3E%20%27application%2Fx-httpd-php%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27php4%27%20%20%3D%3E%20%27application%2Fx-httpd-php%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27php%27%20%20%20%3D%3E%20%27application%2Fx-httpd-php%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27phtml%27%20%3D%3E%20%27application%2Fx-httpd-php%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27phps%27%20%20%3D%3E%20%27application%2Fx-httpd-php-source%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27swf%27%20%20%20%3D%3E%20%27application%2Fx-shockwave-flash%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27sit%27%20%20%20%3D%3E%20%27application%2Fx-stuffit%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27tar%27%20%20%20%3D%3E%20%27application%2Fx-tar%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27tgz%27%20%20%20%3D%3E%20%27application%2Fx-tar%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27xht%27%20%20%20%3D%3E%20%27application%2Fxhtml%2Bxml%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27xhtml%27%20%3D%3E%20%27application%2Fxhtml%2Bxml%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27zip%27%20%20%20%3D%3E%20%27application%2Fzip%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27mid%27%20%20%20%3D%3E%20%27audio%2Fmidi%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27midi%27%20%20%3D%3E%20%27audio%2Fmidi%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27mp2%27%20%20%20%3D%3E%20%27audio%2Fmpeg%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27mp3%27%20%20%20%3D%3E%20%27audio%2Fmpeg%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27mpga%27%20%20%3D%3E%20%27audio%2Fmpeg%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27aif%27%20%20%20%3D%3E%20%27audio%2Fx-aiff%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27aifc%27%20%20%3D%3E%20%27audio%2Fx-aiff%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27aiff%27%20%20%3D%3E%20%27audio%2Fx-aiff%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27ram%27%20%20%20%3D%3E%20%27audio%2Fx-pn-realaudio%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27rm%27%20%20%20%20%3D%3E%20%27audio%2Fx-pn-realaudio%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27rpm%27%20%20%20%3D%3E%20%27audio%2Fx-pn-realaudio-plugin%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27ra%27%20%20%20%20%3D%3E%20%27audio%2Fx-realaudio%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27wav%27%20%20%20%3D%3E%20%27audio%2Fx-wav%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27bmp%27%20%20%20%3D%3E%20%27image%2Fbmp%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27gif%27%20%20%20%3D%3E%20%27image%2Fgif%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27jpeg%27%20%20%3D%3E%20%27image%2Fjpeg%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27jpe%27%20%20%20%3D%3E%20%27image%2Fjpeg%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27jpg%27%20%20%20%3D%3E%20%27image%2Fjpeg%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27png%27%20%20%20%3D%3E%20%27image%2Fpng%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27tiff%27%20%20%3D%3E%20%27image%2Ftiff%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27tif%27%20%20%20%3D%3E%20%27image%2Ftiff%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27eml%27%20%20%20%3D%3E%20%27message%2Frfc822%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27css%27%20%20%20%3D%3E%20%27text%2Fcss%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27html%27%20%20%3D%3E%20%27text%2Fhtml%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27htm%27%20%20%20%3D%3E%20%27text%2Fhtml%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27shtml%27%20%3D%3E%20%27text%2Fhtml%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27log%27%20%20%20%3D%3E%20%27text%2Fplain%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27text%27%20%20%3D%3E%20%27text%2Fplain%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27txt%27%20%20%20%3D%3E%20%27text%2Fplain%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27rtx%27%20%20%20%3D%3E%20%27text%2Frichtext%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27rtf%27%20%20%20%3D%3E%20%27text%2Frtf%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27vcf%27%20%20%20%3D%3E%20%27text%2Fvcard%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27vcard%27%20%3D%3E%20%27text%2Fvcard%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27xml%27%20%20%20%3D%3E%20%27text%2Fxml%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27xsl%27%20%20%20%3D%3E%20%27text%2Fxml%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27mpeg%27%20%20%3D%3E%20%27video%2Fmpeg%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27mpe%27%20%20%20%3D%3E%20%27video%2Fmpeg%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27mpg%27%20%20%20%3D%3E%20%27video%2Fmpeg%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27mov%27%20%20%20%3D%3E%20%27video%2Fquicktime%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27qt%27%20%20%20%20%3D%3E%20%27video%2Fquicktime%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27rv%27%20%20%20%20%3D%3E%20%27video%2Fvnd.rn-realvideo%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27avi%27%20%20%20%3D%3E%20%27video%2Fx-msvideo%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27movie%27%20%3D%3E%20%27video%2Fx-sgi-movie%27%0D%0A%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28array_key_exists%28strtolower%28%24ext%29%2C%20%24mimes%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%24mimes%5Bstrtolower%28%24ext%29%5D%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%27application%2Foctet-stream%27%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Map%20a%20file%20name%20to%20a%20MIME%20type.%0D%0A%20%20%20%20%20%2A%20Defaults%20to%20%27application%2Foctet-stream%27%2C%20i.e..%20arbitrary%20binary%20data.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24filename%20A%20file%20name%20or%20full%20path%2C%20does%20not%20need%20to%20exist%20as%20a%20file%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%20%40static%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20static%20function%20filenameToType%28%24filename%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20In%20case%20the%20path%20is%20a%20URL%2C%20strip%20any%20query%20string%20before%20getting%20extension%0D%0A%20%20%20%20%20%20%20%20%24qpos%20%3D%20strpos%28%24filename%2C%20%27%3F%27%29%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28false%20%21%3D%3D%20%24qpos%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24filename%20%3D%20substr%28%24filename%2C%200%2C%20%24qpos%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24pathinfo%20%3D%20self%3A%3Amb_pathinfo%28%24filename%29%3B%0D%0A%20%20%20%20%20%20%20%20return%20self%3A%3A_mime_types%28%24pathinfo%5B%27extension%27%5D%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Multi-byte-safe%20pathinfo%20replacement.%0D%0A%20%20%20%20%20%2A%20Drop-in%20replacement%20for%20pathinfo%28%29%2C%20but%20multibyte-safe%2C%20cross-platform-safe%2C%20old-version-safe.%0D%0A%20%20%20%20%20%2A%20Works%20similarly%20to%20the%20one%20in%20PHP%20%3E%3D%205.2.0%0D%0A%20%20%20%20%20%2A%20%40link%20http%3A%2F%2Fwww.php.net%2Fmanual%2Fen%2Ffunction.pathinfo.php%23107461%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24path%20A%20filename%20or%20path%2C%20does%20not%20need%20to%20exist%20as%20a%20file%0D%0A%20%20%20%20%20%2A%20%40param%20integer%7Cstring%20%24options%20Either%20a%20PATHINFO_%2A%20constant%2C%0D%0A%20%20%20%20%20%2A%20%20%20%20%20%20or%20a%20string%20name%20to%20return%20only%20the%20specified%20piece%2C%20allows%20%27filename%27%20to%20work%20on%20PHP%20%3C%205.2%0D%0A%20%20%20%20%20%2A%20%40return%20string%7Carray%0D%0A%20%20%20%20%20%2A%20%40static%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20static%20function%20mb_pathinfo%28%24path%2C%20%24options%20%3D%20null%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24ret%20%3D%20array%28%27dirname%27%20%3D%3E%20%27%27%2C%20%27basename%27%20%3D%3E%20%27%27%2C%20%27extension%27%20%3D%3E%20%27%27%2C%20%27filename%27%20%3D%3E%20%27%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%24pathinfo%20%3D%20array%28%29%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28preg_match%28%27%25%5E%28.%2A%3F%29%5B%5C%5C%5C%5C%2F%5D%2A%28%28%5B%5E%2F%5C%5C%5C%5C%5D%2A%3F%29%28%5C.%28%5B%5E%5C.%5C%5C%5C%5C%2F%5D%2B%3F%29%7C%29%29%5B%5C%5C%5C%5C%2F%5C.%5D%2A%24%25im%27%2C%20%24path%2C%20%24pathinfo%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28array_key_exists%281%2C%20%24pathinfo%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24ret%5B%27dirname%27%5D%20%3D%20%24pathinfo%5B1%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28array_key_exists%282%2C%20%24pathinfo%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24ret%5B%27basename%27%5D%20%3D%20%24pathinfo%5B2%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28array_key_exists%285%2C%20%24pathinfo%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24ret%5B%27extension%27%5D%20%3D%20%24pathinfo%5B5%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28array_key_exists%283%2C%20%24pathinfo%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24ret%5B%27filename%27%5D%20%3D%20%24pathinfo%5B3%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20switch%20%28%24options%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20PATHINFO_DIRNAME%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27dirname%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%24ret%5B%27dirname%27%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20PATHINFO_BASENAME%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27basename%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%24ret%5B%27basename%27%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20PATHINFO_EXTENSION%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27extension%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%24ret%5B%27extension%27%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20PATHINFO_FILENAME%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20case%20%27filename%27%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%24ret%5B%27filename%27%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20default%3A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20%24ret%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Set%20or%20reset%20instance%20properties.%0D%0A%20%20%20%20%20%2A%20You%20should%20avoid%20this%20function%20-%20it%27s%20more%20verbose%2C%20less%20efficient%2C%20more%20error-prone%20and%0D%0A%20%20%20%20%20%2A%20harder%20to%20debug%20than%20setting%20properties%20directly.%0D%0A%20%20%20%20%20%2A%20Usage%20Example%3A%0D%0A%20%20%20%20%20%2A%20%60%24mail-%3Eset%28%27SMTPSecure%27%2C%20%27tls%27%29%3B%60%0D%0A%20%20%20%20%20%2A%20%20%20is%20the%20same%20as%3A%0D%0A%20%20%20%20%20%2A%20%60%24mail-%3ESMTPSecure%20%3D%20%27tls%27%3B%60%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24name%20The%20property%20name%20to%20set%0D%0A%20%20%20%20%20%2A%20%40param%20mixed%20%24value%20The%20value%20to%20set%20the%20property%20to%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%20%40TODO%20Should%20this%20not%20be%20using%20the%20__set%28%29%20magic%20function%3F%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20set%28%24name%2C%20%24value%20%3D%20%27%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28property_exists%28%24this%2C%20%24name%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3E%24name%20%3D%20%24value%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20true%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EsetError%28%24this-%3Elang%28%27variable_set%27%29%20.%20%24name%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20false%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Strip%20newlines%20to%20prevent%20header%20injection.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24str%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20secureHeader%28%24str%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20trim%28str_replace%28array%28%22%5Cr%22%2C%20%22%5Cn%22%29%2C%20%27%27%2C%20%24str%29%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Normalize%20line%20breaks%20in%20a%20string.%0D%0A%20%20%20%20%20%2A%20Converts%20UNIX%20LF%2C%20Mac%20CR%20and%20Windows%20CRLF%20line%20breaks%20into%20a%20single%20line%20break%20format.%0D%0A%20%20%20%20%20%2A%20Defaults%20to%20CRLF%20%28for%20message%20bodies%29%20and%20preserves%20consecutive%20breaks.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24text%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24breaktype%20What%20kind%20of%20line%20break%20to%20use%2C%20defaults%20to%20CRLF%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40static%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20static%20function%20normalizeBreaks%28%24text%2C%20%24breaktype%20%3D%20%22%5Cr%5Cn%22%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20preg_replace%28%27%2F%28%5Cr%5Cn%7C%5Cr%7C%5Cn%29%2Fms%27%2C%20%24breaktype%2C%20%24text%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Set%20the%20public%20and%20private%20key%20files%20and%20password%20for%20S%2FMIME%20signing.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24cert_filename%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24key_filename%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24key_pass%20Password%20for%20private%20key%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24extracerts_filename%20Optional%20path%20to%20chain%20certificate%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20sign%28%24cert_filename%2C%20%24key_filename%2C%20%24key_pass%2C%20%24extracerts_filename%20%3D%20%27%27%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Esign_cert_file%20%3D%20%24cert_filename%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Esign_key_file%20%3D%20%24key_filename%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Esign_key_pass%20%3D%20%24key_pass%3B%0D%0A%20%20%20%20%20%20%20%20%24this-%3Esign_extracerts_file%20%3D%20%24extracerts_filename%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Quoted-Printable-encode%20a%20DKIM%20header.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24txt%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20DKIM_QP%28%24txt%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24line%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20for%20%28%24i%20%3D%200%3B%20%24i%20%3C%20strlen%28%24txt%29%3B%20%24i%2B%2B%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24ord%20%3D%20ord%28%24txt%5B%24i%5D%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%28%280x21%20%3C%3D%20%24ord%29%20%26%26%20%28%24ord%20%3C%3D%200x3A%29%29%20%7C%7C%20%24ord%20%3D%3D%200x3C%20%7C%7C%20%28%280x3E%20%3C%3D%20%24ord%29%20%26%26%20%28%24ord%20%3C%3D%200x7E%29%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24line%20.%3D%20%24txt%5B%24i%5D%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24line%20.%3D%20%27%3D%27%20.%20sprintf%28%27%2502X%27%2C%20%24ord%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%24line%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Generate%20a%20DKIM%20signature.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24signHeader%0D%0A%20%20%20%20%20%2A%20%40throws%20phpmailerException%0D%0A%20%20%20%20%20%2A%20%40return%20string%20The%20DKIM%20signature%20value%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20DKIM_Sign%28%24signHeader%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%21defined%28%27PKCS7_TEXT%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%24this-%3Eexceptions%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20throw%20new%20phpmailerException%28%24this-%3Elang%28%27extension_missing%27%29%20.%20%27openssl%27%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24privKeyStr%20%3D%20%21empty%28%24this-%3EDKIM_private_string%29%20%3F%20%24this-%3EDKIM_private_string%20%3A%20file_get_contents%28%24this-%3EDKIM_private%29%3B%0D%0A%20%20%20%20%20%20%20%20if%20%28%27%27%20%21%3D%20%24this-%3EDKIM_passphrase%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24privKey%20%3D%20openssl_pkey_get_private%28%24privKeyStr%2C%20%24this-%3EDKIM_passphrase%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24privKey%20%3D%20openssl_pkey_get_private%28%24privKeyStr%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2FWorkaround%20for%20missing%20digest%20algorithms%20in%20old%20PHP%20%26%20OpenSSL%20versions%0D%0A%20%20%20%20%20%20%20%20%2F%2F%40link%20http%3A%2F%2Fstackoverflow.com%2Fa%2F11117338%2F333340%0D%0A%20%20%20%20%20%20%20%20if%20%28version_compare%28PHP_VERSION%2C%20%275.3.0%27%29%20%3E%3D%200%20and%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20in_array%28%27sha256WithRSAEncryption%27%2C%20openssl_get_md_methods%28true%29%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28openssl_sign%28%24signHeader%2C%20%24signature%2C%20%24privKey%2C%20%27sha256WithRSAEncryption%27%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20openssl_pkey_free%28%24privKey%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20base64_encode%28%24signature%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24pinfo%20%3D%20openssl_pkey_get_details%28%24privKey%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24hash%20%3D%20hash%28%27sha256%27%2C%20%24signHeader%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%27Magic%27%20constant%20for%20SHA256%20from%20RFC3447%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F%2F%40link%20https%3A%2F%2Ftools.ietf.org%2Fhtml%2Frfc3447%23page-43%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24t%20%3D%20%273031300d060960864801650304020105000420%27%20.%20%24hash%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24pslen%20%3D%20%24pinfo%5B%27bits%27%5D%20%2F%208%20-%20%28strlen%28%24t%29%20%2F%202%20%2B%203%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24eb%20%3D%20pack%28%27H%2A%27%2C%20%270001%27%20.%20str_repeat%28%27FF%27%2C%20%24pslen%29%20.%20%2700%27%20.%20%24t%29%3B%0D%0A%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28openssl_private_encrypt%28%24eb%2C%20%24signature%2C%20%24privKey%2C%20OPENSSL_NO_PADDING%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20openssl_pkey_free%28%24privKey%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20base64_encode%28%24signature%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20openssl_pkey_free%28%24privKey%29%3B%0D%0A%20%20%20%20%20%20%20%20return%20%27%27%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Generate%20a%20DKIM%20canonicalization%20header.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24signHeader%20Header%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20DKIM_HeaderC%28%24signHeader%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24signHeader%20%3D%20preg_replace%28%27%2F%5Cr%5Cn%5Cs%2B%2F%27%2C%20%27%20%27%2C%20%24signHeader%29%3B%0D%0A%20%20%20%20%20%20%20%20%24lines%20%3D%20explode%28%22%5Cr%5Cn%22%2C%20%24signHeader%29%3B%0D%0A%20%20%20%20%20%20%20%20foreach%20%28%24lines%20as%20%24key%20%3D%3E%20%24line%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20list%28%24heading%2C%20%24value%29%20%3D%20explode%28%27%3A%27%2C%20%24line%2C%202%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24heading%20%3D%20strtolower%28%24heading%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24value%20%3D%20preg_replace%28%27%2F%5Cs%7B2%2C%7D%2F%27%2C%20%27%20%27%2C%20%24value%29%3B%20%2F%2F%20Compress%20useless%20spaces%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24lines%5B%24key%5D%20%3D%20%24heading%20.%20%27%3A%27%20.%20trim%28%24value%29%3B%20%2F%2F%20Don%27t%20forget%20to%20remove%20WSP%20around%20the%20value%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24signHeader%20%3D%20implode%28%22%5Cr%5Cn%22%2C%20%24lines%29%3B%0D%0A%20%20%20%20%20%20%20%20return%20%24signHeader%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Generate%20a%20DKIM%20canonicalization%20body.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24body%20Message%20Body%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20DKIM_BodyC%28%24body%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%24body%20%3D%3D%20%27%27%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20return%20%22%5Cr%5Cn%22%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20stabilize%20line%20endings%0D%0A%20%20%20%20%20%20%20%20%24body%20%3D%20str_replace%28%22%5Cr%5Cn%22%2C%20%22%5Cn%22%2C%20%24body%29%3B%0D%0A%20%20%20%20%20%20%20%20%24body%20%3D%20str_replace%28%22%5Cn%22%2C%20%22%5Cr%5Cn%22%2C%20%24body%29%3B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%20END%20stabilize%20line%20endings%0D%0A%20%20%20%20%20%20%20%20while%20%28substr%28%24body%2C%20strlen%28%24body%29%20-%204%2C%204%29%20%3D%3D%20%22%5Cr%5Cn%5Cr%5Cn%22%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24body%20%3D%20substr%28%24body%2C%200%2C%20strlen%28%24body%29%20-%202%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20%24body%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Create%20the%20DKIM%20header%20and%20body%20in%20a%20new%20message%20header.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24headers_line%20Header%20lines%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24subject%20Subject%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24body%20Body%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20DKIM_Add%28%24headers_line%2C%20%24subject%2C%20%24body%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24DKIMsignatureType%20%3D%20%27rsa-sha256%27%3B%20%2F%2F%20Signature%20%26%20hash%20algorithms%0D%0A%20%20%20%20%20%20%20%20%24DKIMcanonicalization%20%3D%20%27relaxed%2Fsimple%27%3B%20%2F%2F%20Canonicalization%20of%20header%2Fbody%0D%0A%20%20%20%20%20%20%20%20%24DKIMquery%20%3D%20%27dns%2Ftxt%27%3B%20%2F%2F%20Query%20method%0D%0A%20%20%20%20%20%20%20%20%24DKIMtime%20%3D%20time%28%29%3B%20%2F%2F%20Signature%20Timestamp%20%3D%20seconds%20since%2000%3A00%3A00%20-%20Jan%201%2C%201970%20%28UTC%20time%20zone%29%0D%0A%20%20%20%20%20%20%20%20%24subject_header%20%3D%20%22Subject%3A%20%24subject%22%3B%0D%0A%20%20%20%20%20%20%20%20%24headers%20%3D%20explode%28%24this-%3ELE%2C%20%24headers_line%29%3B%0D%0A%20%20%20%20%20%20%20%20%24from_header%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%24to_header%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%24date_header%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%24current%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20foreach%20%28%24headers%20as%20%24header%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20%28strpos%28%24header%2C%20%27From%3A%27%29%20%3D%3D%3D%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24from_header%20%3D%20%24header%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24current%20%3D%20%27from_header%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20elseif%20%28strpos%28%24header%2C%20%27To%3A%27%29%20%3D%3D%3D%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24to_header%20%3D%20%24header%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24current%20%3D%20%27to_header%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20elseif%20%28strpos%28%24header%2C%20%27Date%3A%27%29%20%3D%3D%3D%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24date_header%20%3D%20%24header%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24current%20%3D%20%27date_header%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20if%20%28%21empty%28%24%24current%29%20%26%26%20strpos%28%24header%2C%20%27%20%3D%3F%27%29%20%3D%3D%3D%200%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24%24current%20.%3D%20%24header%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%24current%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24from%20%3D%20str_replace%28%27%7C%27%2C%20%27%3D7C%27%2C%20%24this-%3EDKIM_QP%28%24from_header%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%24to%20%3D%20str_replace%28%27%7C%27%2C%20%27%3D7C%27%2C%20%24this-%3EDKIM_QP%28%24to_header%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%24date%20%3D%20str_replace%28%27%7C%27%2C%20%27%3D7C%27%2C%20%24this-%3EDKIM_QP%28%24date_header%29%29%3B%0D%0A%20%20%20%20%20%20%20%20%24subject%20%3D%20str_replace%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27%7C%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%27%3D7C%27%2C%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EDKIM_QP%28%24subject_header%29%0D%0A%20%20%20%20%20%20%20%20%29%3B%20%2F%2F%20Copied%20header%20fields%20%28dkim-quoted-printable%29%0D%0A%20%20%20%20%20%20%20%20%24body%20%3D%20%24this-%3EDKIM_BodyC%28%24body%29%3B%0D%0A%20%20%20%20%20%20%20%20%24DKIMlen%20%3D%20strlen%28%24body%29%3B%20%2F%2F%20Length%20of%20body%0D%0A%20%20%20%20%20%20%20%20%24DKIMb64%20%3D%20base64_encode%28pack%28%27H%2A%27%2C%20hash%28%27sha256%27%2C%20%24body%29%29%29%3B%20%2F%2F%20Base64%20of%20packed%20binary%20SHA-256%20hash%20of%20body%0D%0A%20%20%20%20%20%20%20%20if%20%28%27%27%20%3D%3D%20%24this-%3EDKIM_identity%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24ident%20%3D%20%27%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24ident%20%3D%20%27%20i%3D%27%20.%20%24this-%3EDKIM_identity%20.%20%27%3B%27%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20%24dkimhdrs%20%3D%20%27DKIM-Signature%3A%20v%3D1%3B%20a%3D%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24DKIMsignatureType%20.%20%27%3B%20q%3D%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24DKIMquery%20.%20%27%3B%20l%3D%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24DKIMlen%20.%20%27%3B%20s%3D%27%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24this-%3EDKIM_selector%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%3B%5Cr%5Cn%22%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%5Ctt%3D%22%20.%20%24DKIMtime%20.%20%27%3B%20c%3D%27%20.%20%24DKIMcanonicalization%20.%20%22%3B%5Cr%5Cn%22%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%5Cth%3DFrom%3ATo%3ADate%3ASubject%3B%5Cr%5Cn%22%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%5Ctd%3D%22%20.%20%24this-%3EDKIM_domain%20.%20%27%3B%27%20.%20%24ident%20.%20%22%5Cr%5Cn%22%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%5Ctz%3D%24from%5Cr%5Cn%22%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%5Ct%7C%24to%5Cr%5Cn%22%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%5Ct%7C%24date%5Cr%5Cn%22%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%5Ct%7C%24subject%3B%5Cr%5Cn%22%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%5Ctbh%3D%22%20.%20%24DKIMb64%20.%20%22%3B%5Cr%5Cn%22%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%22%5Ctb%3D%22%3B%0D%0A%20%20%20%20%20%20%20%20%24toSign%20%3D%20%24this-%3EDKIM_HeaderC%28%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24from_header%20.%20%22%5Cr%5Cn%22%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24to_header%20.%20%22%5Cr%5Cn%22%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24date_header%20.%20%22%5Cr%5Cn%22%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24subject_header%20.%20%22%5Cr%5Cn%22%20.%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24dkimhdrs%0D%0A%20%20%20%20%20%20%20%20%29%3B%0D%0A%20%20%20%20%20%20%20%20%24signed%20%3D%20%24this-%3EDKIM_Sign%28%24toSign%29%3B%0D%0A%20%20%20%20%20%20%20%20return%20%24dkimhdrs%20.%20%24signed%20.%20%22%5Cr%5Cn%22%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Detect%20if%20a%20string%20contains%20a%20line%20longer%20than%20the%20maximum%20line%20length%20allowed.%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24str%0D%0A%20%20%20%20%20%2A%20%40return%20boolean%0D%0A%20%20%20%20%20%2A%20%40static%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20static%20function%20hasLineLongerThanMax%28%24str%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%2F%2F%2B2%20to%20include%20CRLF%20line%20break%20for%20a%201000%20total%0D%0A%20%20%20%20%20%20%20%20return%20%28boolean%29preg_match%28%27%2F%5E%28.%7B%27.%28self%3A%3AMAX_LINE_LENGTH%20%2B%202%29.%27%2C%7D%29%2Fm%27%2C%20%24str%29%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Allows%20for%20public%20read%20access%20to%20%27to%27%20property.%0D%0A%20%20%20%20%20%2A%20%40note%3A%20Before%20the%20send%28%29%20call%2C%20queued%20addresses%20%28i.e.%20with%20IDN%29%20are%20not%20yet%20included.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20array%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getToAddresses%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3Eto%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Allows%20for%20public%20read%20access%20to%20%27cc%27%20property.%0D%0A%20%20%20%20%20%2A%20%40note%3A%20Before%20the%20send%28%29%20call%2C%20queued%20addresses%20%28i.e.%20with%20IDN%29%20are%20not%20yet%20included.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20array%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getCcAddresses%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3Ecc%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Allows%20for%20public%20read%20access%20to%20%27bcc%27%20property.%0D%0A%20%20%20%20%20%2A%20%40note%3A%20Before%20the%20send%28%29%20call%2C%20queued%20addresses%20%28i.e.%20with%20IDN%29%20are%20not%20yet%20included.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20array%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getBccAddresses%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3Ebcc%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Allows%20for%20public%20read%20access%20to%20%27ReplyTo%27%20property.%0D%0A%20%20%20%20%20%2A%20%40note%3A%20Before%20the%20send%28%29%20call%2C%20queued%20addresses%20%28i.e.%20with%20IDN%29%20are%20not%20yet%20included.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20array%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getReplyToAddresses%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3EReplyTo%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Allows%20for%20public%20read%20access%20to%20%27all_recipients%27%20property.%0D%0A%20%20%20%20%20%2A%20%40note%3A%20Before%20the%20send%28%29%20call%2C%20queued%20addresses%20%28i.e.%20with%20IDN%29%20are%20not%20yet%20included.%0D%0A%20%20%20%20%20%2A%20%40access%20public%0D%0A%20%20%20%20%20%2A%20%40return%20array%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20getAllRecipientAddresses%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20%24this-%3Eall_recipients%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Perform%20a%20callback.%0D%0A%20%20%20%20%20%2A%20%40param%20boolean%20%24isSent%0D%0A%20%20%20%20%20%2A%20%40param%20array%20%24to%0D%0A%20%20%20%20%20%2A%20%40param%20array%20%24cc%0D%0A%20%20%20%20%20%2A%20%40param%20array%20%24bcc%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24subject%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24body%0D%0A%20%20%20%20%20%2A%20%40param%20string%20%24from%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20protected%20function%20doCallback%28%24isSent%2C%20%24to%2C%20%24cc%2C%20%24bcc%2C%20%24subject%2C%20%24body%2C%20%24from%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20%28%21empty%28%24this-%3Eaction_function%29%20%26%26%20is_callable%28%24this-%3Eaction_function%29%29%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%24params%20%3D%20array%28%24isSent%2C%20%24to%2C%20%24cc%2C%20%24bcc%2C%20%24subject%2C%20%24body%2C%20%24from%29%3B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20call_user_func_array%28%24this-%3Eaction_function%2C%20%24params%29%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A%0D%0A%2F%2A%2A%0D%0A%20%2A%20PHPMailer%20exception%20handler%0D%0A%20%2A%20%40package%20PHPMailer%0D%0A%20%2A%2F%0D%0Aclass%20phpmailerException%20extends%20Exception%0D%0A%7B%0D%0A%20%20%20%20%2F%2A%2A%0D%0A%20%20%20%20%20%2A%20Prettify%20error%20message%20output%0D%0A%20%20%20%20%20%2A%20%40return%20string%0D%0A%20%20%20%20%20%2A%2F%0D%0A%20%20%20%20public%20function%20errorMessage%28%29%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%20%20%24errorMsg%20%3D%20%27%3Cstrong%3E%27%20.%20htmlspecialchars%28%24this-%3EgetMessage%28%29%29%20.%20%22%3C%2Fstrong%3E%3Cbr%20%2F%3E%5Cn%22%3B%0D%0A%20%20%20%20%20%20%20%20return%20%24errorMsg%3B%0D%0A%20%20%20%20%7D%0D%0A%7D