Part of the EllisLab Network
   
2 of 2
2
Gmail SMTP using SSL/TLS
Posted: 15 July 2009 04:39 PM   [ Ignore ]   [ # 16 ]  
Summer Student
Avatar
Total Posts:  12
Joined  07-15-2009

Hey Forum.

I made a custom defined using constants.php file on config/constants.php and then developed a custom smtpconfig function on a controller model to suit the smtp email configuration and the use on a send emailtest function on a controller, please visit my weblog to view the solution:


http://www.carlos-alcala.com/?p=84

Just for the note, I have found that PASSING an string array from config/email.php to the library email constructor (load library) has the bug like the initialize on the SMTP_AUTH so the Gmail test nevers authenticates, I have found after several hours of dev/test.

I hope you like this solution, using gmail and it works fine !!


PS. For Windows XAMP users: uncomment the line extension=php_openssl.dll on the php.ini to work with SSL

 Signature 


Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning…

Profile
 
 
Posted: 29 July 2009 04:26 AM   [ Ignore ]   [ # 17 ]  
Summer Student
Total Posts:  11
Joined  07-29-2009

hi.I worked out the code you gave..It shows that “your email is sent” ..but it is not actually sending out the mail..
here the code

<?php

class Test_email extends Controller
{
  function Test_email()
  {
      // load controller parent
      parent::Controller();
      $this->load->library(‘email’);
  }
  function sendEmail()
  {
     

     
      $config = Array(
  ‘protocol’ => ‘smtp’,
  ‘smtp_host’ => ‘ssl://smtp.googlemail.com’,
  ‘smtp_port’ => 465,
  ‘smtp_user’ => ‘name@domain.com’,
  ‘smtp_pass’ => ‘pwd’,
                );
$this->load->library(‘email’, $config);
$this->email->set_newline(”\r\n”);

$this->email->from(‘smithas@qburst.com’, ‘Smitha’);
$this->email->to(‘smithas@qburst.com’);

$this->email->subject(’ CodeIgniter Rocks ‘);
$this->email->message(‘Hello World’);


if (!$this->email->send())
  show_error($this->email->print_debugger());
else
  echo ‘Your e-mail has been sent!’;
       

  }
}

why is this happening?I had openssl enabled..but still the same problem

Profile
 
 
Posted: 01 August 2009 10:09 PM   [ Ignore ]   [ # 18 ]  
Summer Student
Avatar
Total Posts:  12
Joined  07-15-2009

1. I have made the configuration usign constants with DEFINE for ONE SIMPLE REASON, the email library has a bug using an ARRAY CONFIGURATION LOAD LIKE IN YOUR CODE, I have made it that way also with NO SUCCESS, and it seems a problem on the email library constructor usign it that way, so please FOLLOW THE EXAMPLE EXACTLY.

2. Check the port 465 is open on firewall.

3. The show_errors is not showing anything?

4. Are you using a correct Gmail account and password? because you posted a code taht seems a little different from my code.

5. Please follow the code correctly using de DEFINE on the constants.php on my website and then post your results.

6. Please try www.getfirebug.com to verify any errors.

Hope you can get work, this seems a missunderstood problem on your code.

Sincerely,

Carlos

 Signature 


Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning…

Profile
 
 
Posted: 02 August 2009 11:11 PM   [ Ignore ]   [ # 19 ]  
Summer Student
Total Posts:  11
Joined  07-29-2009

thank you.. can u please post me your code?
465 is open.
and email address i gave i s valid one..

Profile
 
 
Posted: 23 August 2009 10:02 PM   [ Ignore ]   [ # 20 ]  
Grad Student
Avatar
Rank
Total Posts:  40
Joined  08-06-2009

This may or may not be the right place to post this. But I will anyway.

I have always thought running your own mail server is a pain, and I always thought using Gmail to send email for your site was only ok for small sites.

I recently discovered this company http://www.sendgrid.com and have been very happy with them so far.

 Signature 

—-
Spicer Matthews
Cloudmanic Labs. LLC
http://www.cloudmanic.com

Profile
 
 
Posted: 22 September 2009 11:38 AM   [ Ignore ]   [ # 21 ]  
Grad Student
Rank
Total Posts:  74
Joined  05-19-2007

Thank you SO MUCH for this! Fixed an issue I’ve been having for months.

Profile
 
 
Posted: 22 September 2009 11:43 AM   [ Ignore ]   [ # 22 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  811
Joined  06-10-2009

Great post/tutorial, thanks for posting it - might come in handy some day smile

 Signature 

CreativeHalls Web Design and Printing
A few of my projects:
OurGulfCoast Property Management and Vacation Rental (ASP/.NET)
BukuBux - Money Saving Coupons and Gift Certificates (CodeIgniter, LAMP/MySQL)
Rentals800.com - Find a place to rent (CodeIgniter, LAMP/MySQL)
bdh (dot) hall (at) gmail (dotcom)

Profile
 
 
Posted: 27 January 2010 01:41 AM   [ Ignore ]   [ # 23 ]  
Grad Student
Rank
Total Posts:  77
Joined  01-24-2010

good job wrs!!
it works! grin

 Signature 

-the Beginner-

Profile
 
 
   
2 of 2
2
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 819, on March 11, 2010 11:15 AM
Total Registered Members: 120294 Total Logged-in Users: 49
Total Topics: 126411 Total Anonymous Users: 4
Total Replies: 664798 Total Guests: 403
Total Posts: 791209    
Members ( View Memberlist )