PHP-SMTP-Mailer
PHP-SMTP-Mailer copied to clipboard
A few issues
- Method generateMessageID,
base_convert(microtime(), 10, 36)throws Deprecated: Invalid characters passed for attempted conversion under PHP 7.4. Either change microtime to time or use a construct like thisbase_convert( str_replace( '.', '', microtime(true) ), 10, 36 )or use something else entirely. - The way the class is currently written disallows sending multiple mails to different recipients, because AddTo method adds each new mail to an array and there is no method to clear it. Doing again
$newMail = new SMTPMailer();throws Notice: Constant NL already defined. Since this class is not written as a singleton, the correct approach would be to replace constant NL definition by a variable or just replace it with"\r\n"string where applied. If it would be written as a singleton, it would need a method to clear$this-to[], and also other arrays like$this->reply_to[],$this->cc[],$this->bcc[]and$this->file[]
Check out this fork for these fixes.