Note that there are some explanatory texts on larger screens.

plurals
  1. POError in sending email in codeigniter
    text
    copied!<p>I am using following configuration for sending mail through php mail function :</p> <pre><code>function sendInvoiceEmail() { </code></pre> <p>GET CUSTOMER EMAIL </p> <pre><code> $recieverEmail = xyz@test.com; //Valid Email ID $recieverName = xyz; </code></pre> <p>CREATE EMAIL CONFIGURATION ARRAY</p> <pre><code> $emailConfig = array( 'protocol' =&gt; 'smtp', 'smtp_host' =&gt; 'ssl://smtp.googlemail.com', 'smtp_port' =&gt; 465, 'smtp_user' =&gt; 'abc@abc.com', //Valid Email ID 'smtp_pass' =&gt; 'password', //Valid password 'mailtype' =&gt; 'html', //text or html 'charset' =&gt; 'iso-8859-1', ); </code></pre> <p>Set your email information</p> <pre><code> $from = array('email' =&gt; 'abc@abc.com', 'name' =&gt; 'Testing'); $to = array('email' =&gt; $recieverEmail, 'name' =&gt; $recieverName); $subject = "Test Mail for Invoice "; $message = "Test Message for Invoice"; </code></pre> <p>Load CodeIgniter Email library</p> <pre><code> $this-&gt;load-&gt;library('email', $emailConfig); $this-&gt;email-&gt;initialize($emailConfig); </code></pre> <p>Sometimes you have to set the new line character for better result</p> <pre><code> $this-&gt;email-&gt;set_newline("\r\n"); </code></pre> <p>Set email preferences</p> <pre><code> $this-&gt;email-&gt;from($from['email'], $from['name']); $this-&gt;email-&gt;to($to['email'], $to['name']); $this-&gt;email-&gt;subject($subject); $this-&gt;email-&gt;message($message); </code></pre> <p>Ready to send email and check whether the email was successfully sent</p> <pre><code> if ($this-&gt;email-&gt;send()) { return true; } else { show_error($this-&gt;email-&gt;print_debugger()); } } </code></pre> <p>I am having PHP 5.3.9 version and wampserver but I am getting following error :</p> <pre><code>An Error Was Encountered The following SMTP error was encountered: 52770504 Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? Unable to send data: AUTH LOGIN Failed to send AUTH LOGIN command. Error: Unable to send data: MAIL FROM: from: The following SMTP error was encountered: Unable to send data: RCPT TO: to: The following SMTP error was encountered: Unable to send data: DATA data: The following SMTP error was encountered: Unable to send data: User-Agent: CodeIgniter Date: Thu, 27 Dec 2012 16:50:28 +0530 From: "Invoice Tester" Return-Path: To: df@df.kl Subject: =?iso-8859-1?Q?Test_Mail_for_Invoice_?= Reply-To: "sujit.singh@xpointers.com" X-Sender: sujit.singh@xpointers.com X-Mailer: CodeIgniter X-Priority: 3 (Normal) Message-ID: &lt;50dc2efca4149@xpointers.com&gt; Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="B_ALT_50dc2efca4160" This is a multi-part message in MIME format. Your email application may not support this format. --B_ALT_50dc2efca4160 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Test Message for Invoice --B_ALT_50dc2efca4160 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Test Message for Invoice --B_ALT_50dc2efca4160-- Unable to send data: . The following SMTP error was encountered: Unable to send email using PHP SMTP. Your server might not be configured to </code></pre> <p>send mail using this method.</p>
 

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