I have what I think is just a really simple question but I cant seem to find the answer on google or i'm just using the wrong terms.
I'm using PHP Mailer to send emails, there's no problem with that.
My problem is on the response headers I am receiving other information. Some smtp client -> server info. That's fine and all, helps me see status of smtp but now i can't read the ajax response from the page.
Is there a way to remove the client -> server info or a way to just read the returned value of the ajax page?
2016-02-27 15:42:06 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP e1sm26974173pas.1 - gsmtp
2016-02-27 15:42:06 CLIENT -> SERVER: EHLO localhost
2016-02-27 15:42:07 SERVER -> CLIENT: 250-smtp.gmail.com at your service, [121.54.58.240]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
2016-02-27 15:42:07 CLIENT -> SERVER: AUTH LOGIN
2016-02-27 15:42:07 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2016-02-27 15:42:07 CLIENT -> SERVER: aUhlbHAuc3d1QGdtYWlsLmNvbQ==
2016-02-27 15:42:07 SERVER -> CLIENT: 334 UGFzc3dvcmQ6
2016-02-27 15:42:07 CLIENT -> SERVER: aWhlbHAxMjM0
2016-02-27 15:42:08 SERVER -> CLIENT: 235 2.7.0 Accepted
2016-02-27 15:42:08 CLIENT -> SERVER:
2016-02-27 15:42:08 SERVER -> CLIENT: 250 2.1.0 OK e1sm26974173pas.1 - gsmtp
2016-02-27 15:42:08 CLIENT -> SERVER:
2016-02-27 15:42:08 SERVER -> CLIENT: 250 2.1.5 OK e1sm26974173pas.1 - gsmtp
2016-02-27 15:42:08 CLIENT -> SERVER: DATA
2016-02-27 15:42:09 SERVER -> CLIENT: 354 Go ahead e1sm26974173pas.1 - gsmtp
2016-02-27 15:42:09 CLIENT -> SERVER: Date: Sat, 27 Feb 2016 16:42:06 +0100
2016-02-27 15:42:09 CLIENT -> SERVER:
2016-02-27 15:42:09 CLIENT -> SERVER:
2016-02-27 15:42:09 CLIENT -> SERVER:
2016-02-27 15:42:09 CLIENT -> SERVER: Subject: Reset password complete
2016-02-27 15:42:09 CLIENT -> SERVER: Message-ID: <fcad829908390aaf1cf72f28886ac1d5#localhost>
2016-02-27 15:42:09 CLIENT -> SERVER: X-Mailer: PHPMailer 5.2.13 (https://github.com/PHPMailer/PHPMailer)
2016-02-27 15:42:09 CLIENT -> SERVER: MIME-Version: 1.0
2016-02-27 15:42:09 CLIENT -> SERVER: Content-Type: multipart/alternative;
2016-02-27 15:42:09 CLIENT -> SERVER: boundary="b1_fcad829908390aaf1cf72f28886ac1d5"
2016-02-27 15:42:09 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit
2016-02-27 15:42:09 CLIENT -> SERVER:
2016-02-27 15:42:09 CLIENT -> SERVER: This is a multi-part message in MIME format.
2016-02-27 15:42:09 CLIENT -> SERVER:
2016-02-27 15:42:09 CLIENT -> SERVER: --b1_fcad829908390aaf1cf72f28886ac1d5
2016-02-27 15:42:09 CLIENT -> SERVER: Content-Type: text/plain; charset=us-ascii
2016-02-27 15:42:09 CLIENT -> SERVER:
2016-02-27 15:42:09 CLIENT -> SERVER:
2016-02-27 15:42:09 CLIENT -> SERVER:
2016-02-27 15:42:09 CLIENT -> SERVER:
2016-02-27 15:42:09 CLIENT -> SERVER: --b1_fcad829908390aaf1cf72f28886ac1d5
2016-02-27 15:42:09 CLIENT -> SERVER: Content-Type: text/html; charset=us-ascii
2016-02-27 15:42:09 CLIENT -> SERVER:
2016-02-27 15:42:09 CLIENT -> SERVER:
2016-02-27 15:42:09 CLIENT -> SERVER:
2016-02-27 15:42:09 CLIENT -> SERVER:
2016-02-27 15:42:09 CLIENT -> SERVER:
2016-02-27 15:42:09 CLIENT -> SERVER: --b1_fcad829908390aaf1cf72f28886ac1d5--
2016-02-27 15:42:09 CLIENT -> SERVER:
2016-02-27 15:42:09 CLIENT -> SERVER: .
2016-02-27 15:42:09 SERVER -> CLIENT: 250 2.0.0 OK 1456587732 e1sm26974173pas.1 - gsmtp
2016-02-27 15:42:09 CLIENT -> SERVER: QUIT
2016-02-27 15:42:10 SERVER -> CLIENT: 221 2.0.0 closing connection e1sm26974173pas.1 - gsmtp
1
I basically just need that "1" at the end as confirmation of ajax call.
Please help. Thank you
Wow, i found my answer as soon as i Posted it here.
Just had to remove
$mail->SMTPDebug = 2;
How silly of me. Thanks anyways!
Related
I had managed to get a laravel/echo/pusher chat application working in my local machine. However once I uploaded to the server the authorization end-point seems failed. I tried a whole bunch of things that just made everything worse.
In my local machine I had (app.js):
window.Echo = new Echo({
authEndpoint : 'https://localhost/**********/*******/public/broadcasting/auth',
broadcaster: 'pusher',
key: '*****************',
cluster: '**',
forceTLS: true,});
which successfully connected to pusher and broadcast events. Chat was working fine.
After uploading to the server I changed this to:
window.Echo = new Echo({
authEndpoint : '/broadcasting/auth',
broadcaster: 'pusher',
key: '**************',
cluster: 'eu',
forceTLS: true,});
Which, I checked, redirects to https://example.com/broadcasting/auth. Now this url initially returned 404. At some point I tried to use again: https://localhost/***/.../broadcasting/auth, which in turn failed as cross origin request.
After playing quite a lot with configuration files, composer and npm somehow the same url returns no specific response anymore.
This is the request:
GET /broadcasting/auth HTTP/1.1
Host: domain_name
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Cookie: XSRF-TOKEN=token_value activebabies_session=session_token
Upgrade-Insecure-Requests: 1
Cache-Control: max-age=0
And this is the response:
HTTP/1.1 200 OK
Date: Wed, 23 Sep 2020 16:26:01 GMT
Server: Apache
Cache-Control: no-cache, private
Set-Cookie: XSRF-TOKEN=token_value; expires=Wed, 23-Sep-2020 18:26:01 GMT; Max-Age=7200; path=/; samesite=lax
Set-Cookie: activebabies_session=session_value; expires=Wed, 23-Sep-2020 18:26:01 GMT; Max-Age=7200; path=/; httponly; samesite=lax
Content-Length: 0
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
There are no errors in the console. At some point there were connections to pusher, just no events broadcast. Currently there are not even connections to pusher.
Any ideas as to why this might be happening? I would be happy to post any additional info that may be required (app.js , .env file, broadcasting.php) but the configuration has to be correct since it worked locally...
I recorded my project website workflow on Jmeter. But On rerunning the recorded samples, all the samples having POST request are failing. I am unable to figure out why the same samples which were passing during recording, are failing on re-run.
Below is request of one of the samples which is failing:
Recorded sample request which passed:
POST https://example.com/live/v1/dashboards/promo_pa/ds/promo_program_dimensions
POST data:
{"query":"promo_program_dimensions.filterby(program_master_id = 'GOGGLE').filterby(dimension_name = 'channel').groupby(dimension_value).aggregate(count(dimension_value) as count).orderby(dimension_value+)"}
[no cookies]
Request Headers:
Connection: keep-alive
Referer: https://example.com/live/v1/dashboards/promo_pa/
Accept-Language: en-US,en;q=0.5
DNT: 1
Accept: */*
X-Requested-With: XMLHttpRequest
Content-Type: application/json
Accept-Encoding: gzip, deflate, br
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:58.0) Gecko/20100101 Firefox/58.0
Content-Length: 216
Host: example.com
Sampler Result:
Thread Name:
Sample Start: 2018-02-22 17:32:44 IST
Load time: 93
Connect Time: 58
Latency: 93
Size in bytes: 647
Sent bytes:1095
Headers size in bytes: 645
Body size in bytes: 2
Sample Count: 1
Error Count: 0
Data type ("text"|"bin"|""): text
Response code: 200
Response message: OK
Response headers:
HTTP/1.1 200 OK
Server: nginx
Date: Thu, 22 Feb 2018 12:02:44 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 2
Connection: keep-alive
Cache-Control: no-cache, no-store, must-revalidate, public, max-age=0
Set-Cookie: live=.eJxNj11vgjAYhf_K0muzMLJdSOIFC6yBQJmuiO1Nw0cdtB0zUEAw_nfRZcbLN2_Oc85zAoGNHA9B9mlDF1gn8JQBCwTm8VD8xH0h3J7CjymFfk92vszHZZklxzpdr1bgvABBBKHrMA-x-MvdzEFVZbzRI1gAtm94WwJLNx2fr6q4wymWr9RRiuJ8iJJtRRLyQsytouJdULwREUQKJfGAkvBWkrfNnulfyes7IhTxQCGqiLkeIqeQaAqn0EElxa5B8feEoK-IkFesDLFnUMd-C4e_zVXBa13p8TntdMn0eODAqjulHj4PY8lua6RwOV6TXcubm8is2XP273q-AI7Dam4.DXBC5A.CJMLbN0B4HC4U8703ZQS50K00lk; HttpOnly; Path=/live
HTTPSampleResult fields:
ContentType: text/html; charset=utf-8
DataEncoding: utf-8
Request of the same sample which is failing on re-run:
POST https://example.com/live/v1/dashboards/promo_pa/ds/promo_program_dimensions
POST data:
{"query":"promo_program_dimensions.filterby(program_master_id = 'GOGGLE').filterby(dimension_name = 'channel').groupby(dimension_value).aggregate(count(dimension_value) as count).orderby(dimension_value+)"}
Cookie Data:
live=.eJxNj11vgjAYhf_K0muzuE4uJPHCBNZgaB0O1Pam4aOu5WsGCqMY__uYy4yXJ2_O857nAvw1cTyC-PsaucC-gKcE2MCHwzmroj7L3Z6htzFGm54eN0VqljI5DHUcrFbgOgP-FiHX4R7h0Ye7m4qlSkSjDZgBfmpEK4Gtm05MSWV3OK5YgR3XohXJcR4tyCgVzvdTSi0WUoshOt86HiRhcHuSts2J669C1HcEgdhgJ10wx3shI4a02uUYRiMNpSIwGFguCxyuzYR6ZaEs8SH4xp9_m1Umaq20eY47Lbk2ZwHsuivLh8vDWHrcz2O0NL_NrhXNTWTS7AX_d73-AAjCaeE.DXBNjA.Fy0Fs7zpVKg-f1qSbAljATOn64E
Request Headers:
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 216
Host: example.com
User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_161)
Sampler Result:
Thread Name: Liberty 1-1
Sample Start: 2018-02-22 18:24:46 IST
Load time: 26
Connect Time: 0
Latency: 26
Size in bytes: 709
Sent bytes:868
Headers size in bytes: 652
Body size in bytes: 57
Sample Count: 1
Error Count: 1
Data type ("text"|"bin"|""): text
Response code: 400
Response message: BAD REQUEST
Response headers:
HTTP/1.1 400 BAD REQUEST
Server: nginx
Date: Thu, 22 Feb 2018 12:54:46 GMT
Content-Type: text/html; charset=utf-8
Content-Length: 57
Connection: keep-alive
Cache-Control: no-cache, no-store, must-revalidate, public, max-age=0
Set-Cookie: live=.eJxNj1tvgjAAhf_K0mezGAcPkvjg0q7B0DKciO1Lw6WGcpuBwizG_z50mfHx5ORcvgvw1hS6FIvPNUbAuYCXBDjAW5xPWR0OWYEGjj_GGG8GdtiUqVnmSXRu4mC1AtcZ8HyMERQuFeEX2k7BSiWy1QbMgDi2ssuBo9teTkplj3JS85JAZLOaFqQILTrmihT7SaU23zGbYzb3obugu-A-knbtUejvUjaPCh9Wio7vFY22ikBm0SKrCeSlDwOL79I3OpajjwOLRTRnUWh4jSz28_dZZbLRSpvXuNe50OYkgdP0VfXkPJ1lh_08xktzS_adbO8gE-YgxT_r9Rcq0WoP.DXBPFg.4Rll1tgU0GdWHWyE73uLkKM8z9c; HttpOnly; Path=/live
HTTPSampleResult fields:
ContentType: text/html; charset=utf-8
DataEncoding: utf-8
Response Data:
{"error": "Failed to authenticate user for data access."}
I have a login sample before this which passed successfully, So user has logged-in successfully before this sample.
I have used
HTTP Cache Manager, HTTP Cookie Manager and HTTP Header Manager. HTTP Cookie Manager will manage the session automatically. Still i am getting authentication error.
i have used the default settings for the sample i.e. "Redirect Automatically" and "Use KeepAlive". I am using JMeter 3.3
Appreciate any pointers.
In the "successful" request you have the following HTTP Headers:
X-Requested-With: XMLHttpRequest
Content-Type: application/json
In the "failing" one you have:
Content-Type: application/x-www-form-urlencoded
So my expectation is that you need to add HTTP Header Manager as a child of the "failing" request and configure it to send Content-Type header with the value of application/json
After I use print debugger to check whether it's sent or not, and here's what I got in return:
bool(false) 220 smtp.gmail.com ESMTP t8sm1776565pgr.21 - gsmtp
hello: 250-smtp.gmail.com at your service, [45.116.123.5]
250-SIZE 35882577
250-8BITMIME
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
Failed to send AUTH LOGIN command. Error: 530 5.7.0 Must issue a STARTTLS command first. t8sm1776565pgr.21 - gsmtp
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
Date: Fri, 2 Feb 2018 13:02:25 +0530
To: demo#example.com
From: "MyWebsite" <demo#example.com>
Return-Path: <demo#example.com>
Subject: =?UTF-8?Q?How=20to=20send=20email=20vi?==?UTF-8?Q?a=20SMTP=20?= =?UTF-8?Q?server=20in=20CodeIgniter?=
Reply-To: <demo#example.com>
User-Agent: CodeIgniter
X-Sender: demo#example.com
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <5a741409bc741#gmail.com>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_5a741409bc741"
This is a multi-part message in MIME format.
Your email application may not support this format.
--B_ALT_5a741409bc741
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sending email via SMTP serverThis email has sent via SMTP server from
CodeIgniter application.
--B_ALT_5a741409bc741
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
=3Ch1=3ESending email via SMTP server=3C/h1=3E=3Cp=3EThis email has sent vi=
a SMTP server from CodeIgniter application.=3C/p=3E
--B_ALT_5a741409bc741--
When I changed the smtp_port to 465 and I got in response like
bool(false)
hello: F
The following SMTP error was encountered: F
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
Date: Fri, 2 Feb 2018 13:12:43 +0530
To: demo#example.com
From: "MyWebsite" <demo#example.com>
Return-Path: <demo#example.com>
Subject: =?UTF-8?Q?How=20to=20send=20email=20vi?==?UTF-8?Q?a=20SMTP=20?= =?UTF-8?Q?server=20in=20CodeIgniter?=
Reply-To: <demo#example.com>
User-Agent: CodeIgniter
X-Sender: demo#example.com
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <5a7416736d6ea#gmail.com>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_5a7416736d6ea"
This is a multi-part message in MIME format.
Your email application may not support this format.
--B_ALT_5a7416736d6ea
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Sending email via SMTP serverThis email has sent via SMTP server from
CodeIgniter application.
--B_ALT_5a7416736d6ea
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
=3Ch1=3ESending email via SMTP server=3C/h1=3E=3Cp=3EThis email has sent vi=
a SMTP server from CodeIgniter application.=3C/p=3E
--B_ALT_5a7416736d6ea--
I have hidden my email id in this question for security purposes.
I find so many code examples that they wanted to change local php.ini and sendmail.ini files to send emails but I think that's not the requirement to send mail using smtp.
I also use the PHPmailer lib and it works for smtp mail, but why CodeIgniter email lib for SMTP is not working? Which PHP version is supported for this CodeIgniter SMTP settings?
Try this:-
$ci = get_instance();
$ci->load->library('email');
$config['protocol'] = "smtp";
$config['smtp_host'] = "mail.google.com";
$config['smtp_port'] = "26";
$config['smtp_user'] = "********#gmail.com";
$config['smtp_pass'] = "************";
$config['charset'] = "utf-8";
$config['mailtype'] = "html";
$config['newline'] = "\r\n";
$ci->email->initialize($config);
$ci->email->from('*********#gmail.com');
$email_body = "Sending Email from server.";
$this->email->to($userEmail']);
$this->email->subject('Email Subject');
$this->email->message($email_body);
$email = $this->email->send();
Im trying to send an E-Mail via PHPMailer. For some Reason I dont understand the authentification fails.
I also tried different things like setting authentification to PLAIN and The Secure Method to TLS, but it doesnt seem to help.
Our Exchange has a Sending Connector, which is sending the E-Mails to our Spam Proxy, which is sending the Mails out to a Mail Server, which is encrypting the Mails with DKIM.
This is my Code:
$mail = new PHPMailer();
$mail->IsSMTP(); // set mailer to use SMTP
$mail->Host = $settings['mailserver']; // specify main and backup server
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Port = "25";
$mail->Username = $settings['mail_domain']."\\".$settings['mail_username']; // SMTP username
echo $mail->Username;
$mail->Password = $settings['mail_password']; // SMTP password
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
$mail->SMTPDebug = 2;
$mail->From = $settings['mail_sender'];
$mail->AddAddress($emp_mail); // name is optional
$mail->AddReplyTo($settings['mail_sender']);
$mail->WordWrap = 50; // set word wrap to 50 characters
//$mail->AddAttachment("/var/tmp/file.tar.gz"); // add attachments
$mail->IsHTML(true); // set email format to HTML
$mail->Subject = "Neue Datei erhalten: ".$filename." - ".$_COOKIE['settings']['firmenname'];
$mail->Body = $text;
$mail->AltBody = "Bitte laden Sie diese Email in der HTML Ansicht";
if(!$mail->Send())
{
$return_code['Code'] = 500;
$return_code['Msg'] = $mail->ErrorInfo.print_r($settings);
}else{
$return_code['Code'] = "200";
}
And this is my answer:
2016-09-26 13:39:44 SERVER -> CLIENT: 220-cpanel-1.fr-hostings.at ESMTP Exim 4.87 #1 Mon, 26 Sep 2016 15:39:44 +0200
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
2016-09-26 13:39:44 CLIENT -> SERVER: EHLO transfer.feurich.com
2016-09-26 13:39:44 SERVER -> CLIENT: 250-cpanel-1.fr-hostings.at Hello cpanel-1.fr-hostings.at [92.222.157.38]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP
2016-09-26 13:39:44 CLIENT -> SERVER: STARTTLS
2016-09-26 13:39:44 SERVER -> CLIENT: 220 TLS go ahead
2016-09-26 13:39:44 CLIENT -> SERVER: EHLO transfer.feurich.com
2016-09-26 13:39:44 SERVER -> CLIENT: 250-cpanel-1.fr-hostings.at Hello cpanel-1.fr-hostings.at [92.222.157.38]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH PLAIN LOGIN
250 HELP
2016-09-26 13:39:44 CLIENT -> SERVER: AUTH LOGIN
2016-09-26 13:39:44 SERVER -> CLIENT: 334 VXNlcm5hbWU6
2016-09-26 13:39:44 CLIENT -> SERVER: xxx=
2016-09-26 13:39:46 SERVER -> CLIENT: 535 Incorrect authentication data
2016-09-26 13:39:46 SMTP ERROR: Username command failed: 535 Incorrect authentication data
2016-09-26 13:39:46 SMTP Error: Could not authenticate.
2016-09-26 13:39:46 CLIENT -> SERVER: QUIT
2016-09-26 13:39:46 SERVER -> CLIENT: 221 cpanel-1.fr-hostings.at closing connection
2016-09-26 13:39:46 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Any Ideas?
After some researches I found out, that this is actually a cPanel Problem! It seems that cPanel is redirecting Outgoing SMTP Connections to the own local Mail Server. This Option can be disabled in
Home »Server Configuration »Tweak Settings
In the cPanel Root Panel.
I just did not think of that, because I saw a Server responding. I just did not recognize, that it was the Own Webservers Mailserver, that was responding
I try to send mail using SMTP using codeigniter. But get following problem.
Even my credential is correct and work fine while i opened in gmail. After that I got below message.
220 smtp.gmail.com ESMTP uo6sm2505144wjc.1 - gsmtp
hello: 250-smtp.gmail.com at your service, [198.58.84.54]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN XOAUTH
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
Failed to authenticate password. Error: 534-5.7.14 Please log in via your web browser and 534-5.7.14 then try again. 534-5.7.14 Learn more at 534 5.7.14 https://support.google.com/mail/answer/78754 uo6sm2505144wjc.1 - gsmtp
from: 530-5.5.1 Authentication Required. Learn more at
530 5.5.1 https://support.google.com/mail/answer/14257 uo6sm2505144wjc.1 - gsmtp
The following SMTP error was encountered: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 https://support.google.com/mail/answer/14257 uo6sm2505144wjc.1 - gsmtp
to: 530-5.5.1 Authentication Required. Learn more at
530 5.5.1 https://support.google.com/mail/answer/14257 uo6sm2505144wjc.1 - gsmtp
The following SMTP error was encountered: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 https://support.google.com/mail/answer/14257 uo6sm2505144wjc.1 - gsmtp
to: 530-5.5.1 Authentication Required. Learn more at
530 5.5.1 https://support.google.com/mail/answer/14257 uo6sm2505144wjc.1 - gsmtp
The following SMTP error was encountered: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 https://support.google.com/mail/answer/14257 uo6sm2505144wjc.1 - gsmtp
data: 530-5.5.1 Authentication Required. Learn more at
530 5.5.1 https://support.google.com/mail/answer/14257 uo6sm2505144wjc.1 - gsmtp
The following SMTP error was encountered: 530-5.5.1 Authentication Required. Learn more at 530 5.5.1 https://support.google.com/mail/answer/14257 uo6sm2505144wjc.1 - gsmtp
502 5.5.1 Unrecognized command. uo6sm2505144wjc.1 - gsmtp
The following SMTP error was encountered: 502 5.5.1 Unrecognized command. uo6sm2505144wjc.1 - gsmtp
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
User-Agent: CodeIgniter
Date: Tue, 11 Aug 2015 11:07:54 +0000
From: "Admin" <sflowask#gmail.com>
Return-Path: <sflowask#gmail.com>
To: pankaj.kumar.k#kindlebit.com
Subject: =?utf-8?Q?Welcome_for_new_signup?=
Reply-To: "sflowask#gmail.com" <sflowask#gmail.com>
X-Sender: sflowask#gmail.com
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <55c9d78b01533#gmail.com>
Mime-Version: 1.0
Content-Type: multipart/alternative; boundary="B_ALT_55c9d78b01d05"
This is a multi-part message in MIME format.
Your email application may not support this format.
You must change $config['protocol'] = "smtp"; to $config['protocol'] = "SMTP";
Let me know if it works for you
Try the following code,may it fixed your issue.It worked perfect for me.
$config = array();
$config['useragent'] = "CodeIgniter";
$config['mailpath'] = "/usr/bin/sendmail"; // or "/usr/sbin/sendmail"
$config['protocol'] = "smtp";
$config['smtp_host'] = "localhost";
$config['smtp_port'] = "25";
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['newline'] = "\r\n";
$config['wordwrap'] = TRUE;
$this->load->library('email');
$this->email->initialize($config);
$this->email->message = "Your Message";
$this->email->subject("Message Subject");
$this->email->from("user#gmail.com");
$this->email->to("admin#gmail.com");
$this->email->send();