Home » Php » rediff mail doen't work in live using codeignitor

rediff mail doen't work in live using codeignitor

Posted by: admin June 30, 2018 Leave a comment


My codeigniter mail function was working fine in google mail and localhost But the same code not working for rediffmail in live .

here is my error message:

hello: 250-smtp.rediffmail.com

Failed to authenticate password. Error: 535 5.7.0 Authorization failed:4
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

User-Agent: CodeIgniter
Date: Thu, 24 May 2018 13:34:14 +0530
To: [email protected]
From: "Kumaran Hospital" <[email protected]>
Return-Path: <[email protected]>
Subject: =?utf-8?Q?=50=61=74=69=65=6E=74=20=44=65=74=61=69=6C=73?=
Reply-To: "[email protected]" <[email protected]>
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0

Content-Type: multipart/mixed; boundary="B_ATC_5b0671fec376f"

    This is a multi-part message in MIME format.
    Your email application may not support this format.

    Content-Type: multipart/alternative; boundary="B_ALT_5b0671fec3734"

    Content-Type: text/plain; charset=utf-8
    Content-Transfer-Encoding: 8bit

    Billed Patient DetailsDear MedPlus, We are attached [email protected] report in
    this mail.DetailsPatient Name:
    [email protected] Mobile number : 8760239085 Insurer Name : ICICI Total Amount :
    8000.000 paid Amount : 0

    Content-Type: text/html; charset=utf-8
    Content-Transfer-Encoding: quoted-printable

    =3Ch1=3EBilled Patient Details=3C/h1=3E=3Cp=3EDear MedPlus,=3Cbr=3E We are =
    attached Prakash=40test report in this mail.=3Cbr=3E=3Cbr=3E=3Ch5=3EDetails=
    =3C/h5=3E=3Cbr=3EPatient Name:
                Prakash=40test=3Cbr=3E Mobile number : 8760239085=3Cbr=3E Insurer Name :=
     ICICI=3Cbr=3E Total Amount : 8000.000=3Cbr=3E paid Amount : 0=3C/p=3E


    Content-type: application/x-unknown-content-type; name="kumaran"
    Content-Disposition: attachment;
    Content-Transfer-Encoding: base64


here is my code.i dont know why my code working in local but not in live.anybody help

public function sendMail(){

        $id = $this->uri->segment(3);

        $email     =  $this->Transaction_model->getEmail($id);
        $arr=  $this->Transaction_model->getFilePath($id);
        $details =  $this->Transaction_model->getEmailDetails($arr[0]->Customer_id);  
        $TPA = $this->Transaction_model->getTPAName($arr[0]->Branch_id);

        $file_path = $arr[0]->file_path;


        //SMTP & mail configuration
        $config = array(
            'protocol'  => 'smtp',
            'smtp_host' => 'ssl://smtp.rediffmail.com',
            'smtp_port' => 465,
            'smtp_user' => '[email protected]',
            'smtp_pass' => '',
            'mailtype'  => 'html',
            'charset'   => 'utf-8'

        //Email content
        $htmlContent = '<h1>Billed Patient Details</h1>';
        $htmlContent .= '<p>Dear '.$TPA.',<br> We are attached '.$details[0]->Customer_name.' report in this mail.<br><br><h5>Details</h5><br>Patient Name:
            '.$details[0]->Customer_name.'<br> Mobile number : '.$details[0]->Mobile_number.'<br> Insurer Name : '.$arr[0]->insurer.'<br> Total Amount : '.$arr[0]->Total_amount.'<br> paid Amount : '.$arr[0]->paid_amount.'</p>';

        $this->email->from('[email protected]','Kumaran Hospital');
        $this->email->subject('Patient Details');

        $attched_file= $_SERVER["DOCUMENT_ROOT"].$file_path;



I already asked in this question for google mail
The question link was Code ignitor mail function working well in my local but not in live and raise error

 I hope same error that link how to change the rediff mail settings?