Welcome Guest, Not a member yet? Register   Sign In
error report
#1

hello I got an error ,could you please help me?? Sad  I want to send mail from my controller page,
.First it showed an error as SMTP,SMTP_port error-check your php.ini file.Later i made some modifications as below:

public function get_data()
 {
 
if(isset($_POST["mail_submit"]))
{    $this->form_validation->set_rules('message', 'message', 'trim|required');//echo "required"

        if ($this->form_validation->run() == FALSE)
          {      
 $this->session->set_flashdata('msg','<div class="alert alert-success text-center">      
                                          Your mail cannot be send without a subject! select one <-]'.$from_email.'</div>');  
redirect('welcome/admin');

         
  else{
  $login_id=$this->input->post('login_id');
$email=$this->input->post('email'); // exit();
       $message = $this->input->post('message');
                                 $to_email = $this->input->post('email');
               $config['protocol'] = 'mail';
       $this->email->initialize($config);          
                                       $this->load->library('email');

$this->email->from('[email protected]', 'ashna');
$this->email->to($to_email);
$this->email->cc('[email protected]');
$this->email->bcc('[email protected]');
  $this->email->subject('SUBJECT HERE');
$this->email->message($message);
                             if ($this->email->send())
                             { echo "success"; exit();
                                $this->session->set_flashdata('msg','<div class="alert alert-success text-center">Your mail has  
                                been sent  successfully!</div>');    
 redirect('welcome/admin');
                              }  
                             else
                              {
                                     echo "error"; exit();
    show_error($this->email->print_debugger());
                             }}}



in my libraies->email.php,I made some changes like:

var $protocol = "mail"; // mail/sendmail/smtp
var $smtp_host = "localhost"; // SMTP Server.  Example: mail.earthlink.net
var $smtp_user = ""; // SMTP Username
var $smtp_pass = ""; // SMTP Password
var $smtp_port = "25"; // SMTP Port
var $smtp_timeout = 5; // SMTP Timeout in seconds
var $smtp_crypto = ""; // SMTP Encryption. Can be null, tls or ssl.
var $wordwrap = TRUE; // TRUE/FALSE  Turns word-wrap on/off
var $wrapchars = "76"; // Number of characters to wrap at.
var $mailtype = "text"; // text/html  Defines email formatting
var $charset = "utf-8"; // Default char set: iso-8859-1 or us-ascii
var $send_multipart = TRUE;


I made these changes only,but nowthe email send message "success" is displaying but actually the mail is not sending to the particular mail id...please help me! Confused
Reply
#2

it's probably a local mail config issue. So you should check your systems mail config. If you're not able to contact your hosting provider /sys-admin

Cheers

(09-10-2015, 02:56 AM)selingouri Wrote: hello I got an error ,could you please help me?? Sad  I want to send mail from my controller page,
.First it showed an error as SMTP,SMTP_port error-check your php.ini file.Later i made some modifications as below:

public function get_data()
 {
 
if(isset($_POST["mail_submit"]))
{    $this->form_validation->set_rules('message', 'message', 'trim|required');//echo "required"

        if ($this->form_validation->run() == FALSE)
          {      
 $this->session->set_flashdata('msg','<div class="alert alert-success text-center">      
                                          Your mail cannot be send without a subject! select one <-]'.$from_email.'</div>');  
redirect('welcome/admin');

         
  else{
  $login_id=$this->input->post('login_id');
$email=$this->input->post('email'); // exit();
       $message = $this->input->post('message');
                                 $to_email = $this->input->post('email');
               $config['protocol'] = 'mail';
       $this->email->initialize($config);          
                                       $this->load->library('email');

$this->email->from('[email protected]', 'ashna');
$this->email->to($to_email);
$this->email->cc('[email protected]');
$this->email->bcc('[email protected]');
  $this->email->subject('SUBJECT HERE');
$this->email->message($message);
                             if ($this->email->send())
                             { echo "success"; exit();
                                $this->session->set_flashdata('msg','<div class="alert alert-success text-center">Your mail has  
                                been sent  successfully!</div>');    
 redirect('welcome/admin');
                              }  
                             else
                              {
                                     echo "error"; exit();
    show_error($this->email->print_debugger());
                             }}}



in my libraies->email.php,I made some changes like:

var $protocol = "mail"; // mail/sendmail/smtp
var $smtp_host = "localhost"; // SMTP Server.  Example: mail.earthlink.net
var $smtp_user = ""; // SMTP Username
var $smtp_pass = ""; // SMTP Password
var $smtp_port = "25"; // SMTP Port
var $smtp_timeout = 5; // SMTP Timeout in seconds
var $smtp_crypto = ""; // SMTP Encryption. Can be null, tls or ssl.
var $wordwrap = TRUE; // TRUE/FALSE  Turns word-wrap on/off
var $wrapchars = "76"; // Number of characters to wrap at.
var $mailtype = "text"; // text/html  Defines email formatting
var $charset = "utf-8"; // Default char set: iso-8859-1 or us-ascii
var $send_multipart = TRUE;


I made these changes only,but nowthe email send message "success" is displaying but actually the mail is not sending to the particular mail id...please help me! Confused
Reply




Theme © iAndrew 2016 - Forum software by © MyBB