setUsername(MAIL_SMTP_USERNAME); $transport->setPassword(MAIL_SMTP_PASSWORD); $transport->setEncryption(MAIL_SMTP_ENCRYPTION); if (HTTP_VERIFY_SSL_CERTIFICATE === false) { $transport->setStreamOptions(array( 'ssl' => array( 'allow_self_signed' => true, 'verify_peer' => false, 'verify_peer_name' => false, ) )); } return $transport; } }