#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    24
    Rep Power
    0

    Codeigniter email


    I am facing the problem in email sending in codeigniter.it is not showing any error and $this->email->send() function is working but not getting the mail in my gmail account.can anybody help me??
    here is the code i am using
    PHP Code:
    class email extends CI_Controller
    {
        
        
        function 
    index()
        {
            
    $config['protocol']='smtp';  
                   
    $config['smtp_host']='ssl://smtp.googlemail.com';  
                   
    $config['smtp_port']='465';  
                   
    $config['smtp_timeout']='30';  
                   
    $config['smtp_user']='preetvision@gmail.com';  
                   
    $config['smtp_pass']='passwrd';  
                   
    $config['charset']='utf-8';  
                   
    $config['newline']="\r\n";
                   
    $this->load->library('email',$config);

            
    $this->email->from('gurpreet1080@gmail/com');
            
    $this->email->to('preetvision@gmail.com');
            
    $this->email->subject('testing');
            
    $this->email->message('send mesg');
            if(
    $this->email->send())
            echo 
    "mail sent";
            
    show_error($this->email->print_debugger());
            
        }

  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2008
    Location
    India
    Posts
    10
    Rep Power
    0
    I also faced same situations, then I just changed the class.
    Try
    https://github.com/Synchro/PHPMailer
    http://swiftmailer.org/
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    24
    Rep Power
    0

    codeigniter email


    i tried phpmailer it is awsm for sending emails.but how to integrate it with codeigniter???
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2008
    Location
    India
    Posts
    10
    Rep Power
    0
    put phpmailer in library folder

    and do something like this:

    require_once APPPATH."libraries/phpmailer/classfile.php"
    $m = new Phpmailer()

    This is not the exact code. But this will give you idea on using php mailer.
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    24
    Rep Power
    0
    it is done...thanx a lot...
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    24
    Rep Power
    0

    codeigniter -email


    Hello...last time i got the solution of my problem of email in codeigniter via phpmailer..
    I am facing problem with attachment

    $mail->AddAttachment("images/phpmailer.gif");

    i have put the php-mailer in libraries folder and linked as

    require_once APPPATH."libraries/PHPMailer-master/class.phpmailer.php";

    is there any problem in path of attachment ???
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2008
    Location
    India
    Posts
    10
    Rep Power
    0
    $mail->AddAttachment("images/phpmailer.gif");

    Can you tell me, what error are you getting?

    Make sure "images/phpmailer.gif" path is correct. Try to use full file path.
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    24
    Rep Power
    0
    it worked. May be the problem was with path .thanx...

IMN logo majestic logo threadwatch logo seochat tools logo