Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to connect to SMTP server. in CakePHP
    primarykey
    data
    text
    <p>I got this error in cakephp using the smtp mail function</p> <p>cakephp code:</p> <pre><code>... try{ $emailClass = new CakeEmail(); $emailClass-&gt;config(array( 'host' =&gt; 'ssl://'.$this-&gt;smtpHostName, 'port' =&gt; $this-&gt;smtpPort, 'username' =&gt; $this-&gt;smtpUserName, 'password' =&gt; $this-&gt;smtpPassword, 'transport' =&gt; 'Smtp' )); $emailClass-&gt;from(array($this-&gt;from =&gt; $this-&gt;fromName)); $emailClass-&gt;to($user_email); $emailClass-&gt;subject($subject); $emailClass-&gt;emailFormat('html'); $contents = $emailClass-&gt;send($message_text); if (!empty($contents)) return true; } catch (Exception $e){ pr($e); } ... </code></pre> <p>error trace:</p> <pre><code> ... [_messageTemplate:protected] =&gt; [message:protected] =&gt; Unable to connect to SMTP server. [string:Exception:private] =&gt; [code:protected] =&gt; 500 [file:protected] =&gt; /opt/lampp/htdocs/site/lib/Cake/Network/Email/SmtpTransport.php [line:protected] =&gt; 96 [trace:Exception:private] =&gt; Array ... </code></pre> <p>Verified that the smtp configuration is correct because I was able to send an email using phpmail</p> <pre><code>... $headers = array ('From' =&gt; $from, 'To' =&gt; $to, 'Subject' =&gt; $subject); $smtp = Mail::factory('smtp', array ('host' =&gt; $host, 'auth' =&gt; true, 'port' =&gt; 25, 'debug' =&gt; true, 'username' =&gt; $username, 'password' =&gt; $password)); $mail = $smtp-&gt;send($to, $headers, $body); ... </code></pre> <p>I'm not sure if it has something to do with cakephp's config because the email code is working on another server. </p> <p>tried:</p> <pre><code>fsockopen('ssl://hosthere', porthere); </code></pre> <p>ssl problem?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload