Welcome Guest, Not a member yet? Register   Sign In
Sending email with gmail smtp with codeigniter email library
#1

[eluser]Unknown[/eluser]
hello every1 .
This is my 1st post here.
i have almost completed my project. But i can't send a single mail with CI Sad.
please help me .
class Email extends Controller {
Code:
function Email()
{
        parent::Controller();  
            $this->load->library('email');
}

function index()
{
    $config['protocol']    = 'smtp';
    $config['smtp_host']    = 'ssl://smtp.gmail.com';
    $config['smtp_port']    = '465';
    $config['smtp_timeout'] = '7';
    $config['smtp_user']    = '[email protected]';
    $config['smtp_pass']    = '*******';
    $config['charset']    = 'utf-8';
    $config['newline']    = "\r\n";
    $config['mailtype'] = 'text'; // or html
    $config['validation'] = TRUE; // bool whether to validate email or not      

    $this->email->initialize($config);


    $this->email->from('[email protected]', 'myname');
    $this->email->to('[email protected]');

    $this->email->subject('Email Test');
    $this->email->message('Testing the email class.');  

    $this->email->send();

    echo $this->email->print_debugger();

     $this->load->view('email_view');

   }

I am getting this error A PHP Error was encountered

Severity: Warning

Message: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Connection timed out)

Filename: libraries/Email.php

Line Number: 1641

Using PORT 25/587 I got this error

"""A PHP Error was encountered

Severity: Warning

Message: fsockopen() [function.fsockopen]: SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:func(119):reason(252)

Filename: libraries/Email.php

Line Number: 1641""""

I dont want to use phpmailer now. (Actually i have tried to use phpmailer,but i falied )


Messages In This Thread
Sending email with gmail smtp with codeigniter email library - by El Forum - 10-18-2009, 11:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB