Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to send email with CodeIgniter
    primarykey
    data
    text
    <p>I am a novice to CI and PHP. Currently I'm using xammp to run PHP, Apache and MySql. Now I am trying to send an email with CI. But I constantly got an error as below.</p> <blockquote> <p>A PHP Error was encountered</p> <p>Severity: Warning</p> <p>Message: fsockopen(): unable to connect to ssl://smtp.googlemail.com:465 (A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. )</p> <p>Filename: libraries/Email.php</p> <p>Line Number: 1689</p> </blockquote> <p>I have google about three hours and still not found the solution. I have already enabled '<code>openssl</code>' in Apache. I would like to describe coding for my Email Controller Class.</p> <p>//Code of Email Controller 'Index' function</p> <pre><code>$this-&gt;load-&gt;library('email'); $this-&gt;email-&gt;set_newline("\r\n"); $config['charset'] = 'utf-8'; $config['wordwrap'] = TRUE; $config['mailtype'] = 'html'; $config['protocol'] = 'smtp'; $config['smtp_port'] = 465; $config['smtp_host'] = 'ssl://smtp.googlemail.com'; $config['smtp_user'] = "something@gmail.com"; $config['smtp_pass'] = "xxx"; $this-&gt;email-&gt;initialize($config); $this-&gt;email-&gt;from('something@gmail.com', 'NayLinAung'); $this-&gt;email-&gt;to('something@gmail.com'); $this-&gt;email-&gt;subject('This is an email test'); $this-&gt;email-&gt;message("It is working, Great! You will be successful."); if ($this-&gt;email-&gt;send()) { echo "Email was successfully sent."; } else { show_error($this-&gt;email-&gt;print_debugger()); } </code></pre> <p>When I change 'smtp' to 'mail', errors are not occurred but the email was not actually sent. In addition, I shutdown my Windows firewall. </p> <p>Please, suggest any solutions for this error.</p>
    singulars
    1. This table or related slice is empty.
    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