I have been trying for last 3 days to resolve the issue and have searched many websites and stackoverflow question but it seems my code is perfect but still it is not working.
function send_email(){
$this->load->library('email');
$config['protocol'] = "smtp";
$config['smtp_host'] = "mail.shadowmail.com.au";
$config['smtp_port'] = 587;
$config['smtp_timeout']='30';
$config['smtp_user'] = "my email id here "; //
$config['smtp_pass'] = "******";
$this->email->initialize($config);
$this->email->set_newline("\r\n");
$this->email->from("my email id here ", "Test");
$this->email->to("[email protected]");
$this->email->subject("heading");
$this->email->message("heyyyyyyyyyyyy");
if($this->email->send()){
echo "done";
}else{echo "fail";
show_error($this->email->print_debugger());
}
}
This error I am getting
220 Sol1-SMEX01.shadowmail.sol1 Microsoft ESMTP MAIL Service ready at Thu, 18 Jan 2018 10:39:18 +1100
hello: 250-Sol1-SMEX01.shadowmail.sol1 Hello [1.136.213.103]
250-SIZE 41943040
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-AUTH GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250 CHUNKING
Failed to send AUTH LOGIN command. Error: 504 5.7.4 Unrecognized authentication type
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
Date: Thu, 18 Jan 2018 00:39:28 +0100
From: "Test" <my email id was here , i just replaced it with this text>
Return-Path: <my email id was here , i just replaced it with this text>
To: [email protected]
Subject: =?UTF-8?Q?heading?=
Reply-To: <my email id was here , i just replaced it with this text>
User-Agent: CodeIgniter
X-Sender: my email id was here , i just replaced it with this text
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
heyyyyyyyyyyyy
It could be basic question for you but I have been trying for last 3 days and still getting same error. It seems code is ok, might be something is wrong I am unable to identify. My email id and password are correct, I have logged in many times to verify that credentials are working.
Codeigniter's email library doesn't seem to support anything but the most basic, insecure authentication method, [LOGIN, basically plaintext] and your SMTP server only supports actual secure authentication methods. [GSSAPI and NTLM]
You need either need to:
LOGINSTARTTLS in the listed capabilities.Of these options #1 is your best bet because:
GSSAPI or NTLM.TLDR: You're going to have to yell at your host.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With