0
votes

Here is my settings for sending the mail using SMTP

 $config = Array(
                'protocol' => 'smtp',
                'smtp_host' => 'ssl://smtp.gmail.com',
                'smtp_port' => 465,
                'smtp_user' => 'example@gmail.com', // change it to yours
                'smtp_pass' => 'example', // change it to yours
                'mailtype' => 'html',
                'wordwrap' => TRUE
 );
        $this->load->library('email',$config);
        $this->email->set_newline("\r\n");
        $data = "Username:".$_POST['username']."\n\nPassword:".$_POST['password']."\n\n";
        $message="Your login details for Spotmyticket Agent portal\n\n". $data."\n\n";

        $message.="Click here to login<a href='http://root5solutions.com/agentspotmyticket/'>login</a>";

        $this->email->from('admin@spotmyticket.in','SpotMyticket');
        $this->email->to('example@gmail.com');

        $this->email->subject('Spotmyticket Agentportal login details');

        $this->email->message($message);
        $this->email->send()

This is the error message i'm getting

hello: 220-p3plcpnl0950.prod.phx3.secureserver.net ESMTP Exim 4.85 #2 Fri, 29 Jan 2016 00:01:29 -0700 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail. The following SMTP error was encountered: 220-p3plcpnl0950.prod.phx3.secureserver.net ESMTP Exim 4.85 #2 Fri, 29 Jan 2016 00:01:29 -0700 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail. Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method. User-Agent: CodeIgniter Date: Fri, 29 Jan 2016 12:31:24 +0530 From: "SpotMyticket" Return-Path: To: shamonsha665@gmail.com Subject: =?UTF-8?Q?Spotmyticket=20Agentpo?==?UTF-8?Q?rtal=20logi?==?UTF-8?Q?n?= =?UTF-8?Q?=20details?= Reply-To: "admin@spotmyticket.in" X-Sender: admin@spotmyticket.in X-Mailer: CodeIgniter X-Priority: 3 (Normal) Message-ID: <56ab0e449ee15@spotmyticket.in> Mime-Version: 1.0

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

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

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

1
Did you read the error? "We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail. Unable to send email using PHP SMTP"Repox
It means that Google isn't allowing you to send out mails thew way you're trying to do it. You should consider using a service specifically for that purpose like Mandrill.Repox
Please contact your hosting provider and they will be able to help you.Tpojka

1 Answers

1
votes

gmail smtp not working properly,its better to use own domain smtp details