Welcome Guest, Not a member yet? Register   Sign In
Cannot send mails using SMTP
#1
Sad 

Hello!

I'm trying to send mails using SMTP connecting to Office 365 account. Unfortunately it stops... Here are things I could see.

Code:
Severity: Warning --> stream_socket_enable_crypto(): SSL: crypto enabling timeout /home/ekspert/domains/szkola-ekspert.pl/danestrony/system/libraries/Email.php 2006
ERROR - 2016-06-23 17:01:30 -->

220 AM2PR09CA0019.outlook.office365.com Microsoft ESMTP MAIL Service ready at Thu, 23 Jun 2016 15:08:16 +0000
<br /><pre>hello: </pre>The following SMTP error was encountered: <br /><pre>starttls: </pre>The following SMTP error was encountered: <br />The following SMTP error was encountered: <br />Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.<br /><pre>User-Agent: CodeIgniter
Date: Thu, 23 Jun 2016 17:01:15 +0200
From: &lt;*****************************&gt;
Return-Path: &lt;*****************************&gt;
To: *****************************
Subject: =?UTF-8?Q?Wy=C5=9Bwietlono=20stron=C4=99?==?UTF-8?Q?!?=
Reply-To: &lt;*****************************&gt;
X-Sender: *****************************
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: &lt;576bf9bbbe287@*****************************&gt;
Mime-Version: 1.0


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

&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;&lt;title&gt;Ktoś wyświetlił stronę!&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;p&gt;Ktoś wyświetlił stronę eszkola w języku pl.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</pre>

The error is:
Code:
A PHP Error was encountered

Severity: Warning

Message: stream_socket_enable_crypto(): SSL: crypto enabling timeout

Filename: libraries/Email.php

Line Number: 2006

Backtrace:

File: /home/********************/domains/****************/danestrony/application/models/Pages_model.php
Line: 50
Function: send

File: /home/********************/domains/****************/danestrony/application/controllers/Pages.php
Line: 11
Function: getPage

File: /home/********************/domains/****************/public_html/index.php
Line: 338
Function: require_once

And my code:

PHP Code:
$this->load->library('email');

$this->email->from('*****************************');
$this->email->to('*****************************');
$this->email->subject('Wyświetlono stronę!');
$this->email->message('<!DOCTYPE html><html><head><title>Ktoś wyświetlił stronę!</title></head><body><p>Ktoś wyświetlił stronę ' $link ' w języku ' $lang '.</p></body></html>');
$this->email->send();

if(!
$this->email->send()) {
    
log_message('error'PHP_EOL.PHP_EOL.$this->email->print_debugger().PHP_EOL.PHP_EOL);


Config file (application/config/email.php):
Code:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

$config['crlf'] = '\r\n';
$config['newline'] = '\r\n';
$config['wordwrap'] = FALSE;

$config['protocol'] = 'smtp';
$config['smtp_host'] = 'smtp.office365.com';
$config['smtp_port'] = 587;
$config['smtp_user'] = '*****************************';
$config['smtp_pass'] = '*****************************';
$config['smtp_crypto'] = 'tls';
$config['smtp_timeout'] = 5;
Reply


Messages In This Thread
Cannot send mails using SMTP - by pjlyoko - 06-23-2016, 08:19 AM
RE: Cannot send mails using SMTP - by InsiteFX - 06-23-2016, 11:14 AM
RE: Cannot send mails using SMTP - by pjlyoko - 06-25-2016, 06:42 AM
RE: Cannot send mails using SMTP - by pjlyoko - 02-12-2017, 11:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB