Zend Mail Gmail SMTP

前端 未结 4 948
轻奢々
轻奢々 2020-12-09 22:49

Hi I\'m trying to send some emails via gmail from the Zend_Mail module. This is my code:

$config = array(
    \'ssl\' => \'tls\',
    \'port\' => 587,         


        
相关标签:
4条回答
  • 2020-12-09 22:53

    I was having a similar problem here is what worked; Using Zend mail transport and yahoo smtp:

    $mailhost= 'smtp.example.com';
    $mailconfig = array(
        'auth'     => 'login',
        'username' => 'me@example.com',
        'password' => 'topsecret',
        'port'     => '465',
        'ssl'      => 'ssl'
    );
    $transport = new Zend_Mail_Smtp($mailhost, $mailconfig);
    Zend_Mail::setDefaultTransport($transport);
    

    This produced an error: "Permission denied" and no mail was sent. After three weeks of trying all solutions I could find the one that worked was changing: $transport to; $transport = new Zend_Mail_Transport_Sendmail('-fsupport@website.com',$mailhost, $mailconfig);

    works as expected...

    0 讨论(0)
  • 2020-12-09 23:04

    Try setting ssl:// as prefix for the hostname and use 465 as port.

    0 讨论(0)
  • 2020-12-09 23:06

    openssl.dll is the windows openssl extension.

    On Linux you need to compile PHP with OpenSSL support. http://www.php.net/manual/en/openssl.installation.php

    You need OpenSSL for PHP sockets and stream functions to use TLS. Zend uses these functions and thus require the same.

    0 讨论(0)
  • 2020-12-09 23:10

    It's very comfortably to use Zend_Mail::setDefaultTransport method

    0 讨论(0)
提交回复
热议问题