0
votes

I don't know how to troubleshoot this. It works locally but not on my godaddy server. Where can I get all my variable options for SSL

I found an answer here I want to try PHPMailer GoDaddy Server SMTP Connection Refused

It says I have to use

SMTP_SERVER: smtpout.secureserver.net (or alternatively relay-hosting.secureserver.net)

SMTP_PORT: 465 //or 3535 or 80 or 25

SMTP_AUTH: true //always

SMTP_Secure: 'ssl' //only if using port 465

How do I set these values with the transport. I know port is 'port' and 'SMTP_SERVER' is 'host' but is 'SMTP_AUTH', 'auth'?

 /*Email Transport*/
 'EmailTransport' => [
   'gmail' => [
               'host' => 'ssl://smtp.gmail.com',
           //'host' => 'relay-hosting.secureserver.net',
          //'host' => 'ASPMX.L.GOOGLE.COM',
          //'host'=>'smtpout.secureserver.net',
          'port' => 465,
          'username' => '-----@gmail.com',
          'password' => 'password',
          'className' => 'Smtp',
          'log' => true,

        ],
],
 'Email' => [
    'default' => [
        'transport' => 'gmail'

    ],
2

2 Answers

0
votes

I think that you cannot set that option in the array because the SMTP Transport class handles it internally. Check the code please of the class.

https://api.cakephp.org/3.3/source-class-Cake.Mailer.Transport.SmtpTransport.html#241-268

0
votes

This works fine here. CakePHP will automatically use SMTP AUTH when you specify username and password. SSL will be used by prefixing the host with ssl:// and the appropriate port as you did.

'Email' => [
    'default' => [
        'transport' => 'gmail'
    ]
],
'EmailTransport' => [
    'gmail' => [
        'host' => 'ssl://smtp.gmail.com',
        'port' => 465,
        'username' => 'googleUserNameWithout', //without the @gmail.com
        'password' => 'P4ssw0rd',
        'className' => 'Smtp'
    ]
]