email - How to enable PHP OpenSSL transports wrappers for use with SwitftMailer -
due low volume of emails sent php script, switching sendgrid gmail's smtp in swiftmailer setup.
in working code, have this:
$transport = swift_smtptransport::newinstance('smtp.sendgrid.net', 587)
for gmail smtp have this:
$transport = swift_smtptransport::newinstance('smtp.gmail.com', 587, 'tls')
when try send email script, following error switfmailer:
uncaught exception 'swift_transportexception' message 'failed authenticate on smtp server username "myemailaddress@gmail.com" using 2 possible authenticators' in /usr/share/php/swift/classes/swift/transport/esmtp/authhandler.php:171
according swiftmailer documentation:
for ssl or tls encryption work php installation must have appropriate openssl transports wrappers. can check if "tls" and/or "ssl" present in php installation using php function stream_get_transports().
i assume authentication error caused lack of "openssl transports wrappers". however, have not been able determine whether have installed , enabled in php configuration. executing stream_get_transports()
in interactive php shell (php -a
), advised switftmailer documentation, not return anything.
how can install , enable "openssl transports wrappers" swiftmailer documentation refers to?
Comments
Post a Comment