Welcome Guest, Not a member yet? Register   Sign In
Sending mail from live
#1

[eluser]someone Smile[/eluser]
Hello!

I would like to set CodeIgniter's email library to send mail from smtp.live.com. But there is problem because I changed so many things in my config variables and the last response from CodeIgniter was neverend loading. So here is my config:

Code:
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'tcp://smtp.live.com';
$config['smtp_port'] = 587;
$config['smtp_crypto'] = 'tls';
$config['smtp_user'] = 'mail@domain';
$config['smtp_pass'] = 'password';

I don't know what else I can try, so any help would be really appreciated.
#2

[eluser]ortwin.van.vessem[/eluser]
Try the following settings:

Code:
$config = array(
    'protocol' => 'smtp',
    'smtp_host' => 'ssl://smtp.live.com',
    'smtp_port' => 587,
    'smtp_user' => '[email protected]',
    'smtp_pass' => 'password'

);

After the send function place the following to view any errors:

Code:
$this->email->send();
echo $this->email->print_debugger();
#3

[eluser]someone Smile[/eluser]
Thanks Smile I don't know what's wrong but there is a lot of PHP errors:

Code:
Message: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
Filename: libraries/Email.php
Line Number: 1689

Message: fsockopen(): Failed to enable crypto
Filename: libraries/Email.php
Line Number: 1689

Message: fsockopen(): unable to connect to ssl://smtp.live.com:587 (Unknown error)
Filename: libraries/Email.php
Line Number: 1689

Message: fwrite() expects parameter 1 to be resource, boolean given
Filename: libraries/Email.php
Line Number: 1846

.
.
.

What can I do now?
#4

[eluser]ortwin.van.vessem[/eluser]
Add the following:

Code:
$config['smtp_crypto']  = "tls" or " ssl";

Are you running from a local environment. If so you will need to change the php.ini file to allow SSL connections.
#5

[eluser]someone Smile[/eluser]
If I've add crypto for 'ssl' I got this error which is almost basical (the shouldn't be ssl:// in host):
Code:
Message: fsockopen(): unable to connect to ssl://ssl://smtp.live.com:587 (php_network_getaddresses: getaddrinfo failed: Name or service not known)

If I deleted 'ssl://' in host then there was the same list of errors as before:
Code:
Message: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
.
.
.

If I choose crypto = 'tls' there was just neverending load without any error in logs. And if I left 'ssl://' in host address there were same errors as this one above.

Code:
Message: fsockopen(): SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
.
.
.

It's maybe problem in server? I'm doing this on production server (far away from public) and do I need any additional thing for php or apache?

EDIT: I'm getting same error on localhost and prod. server.
#6

[eluser]ortwin.van.vessem[/eluser]
In your php.ini ensure you have enabled php_openssl. In case you have a Google account try it with the Google credentials:

Code:
'protocol'  => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => '465',
'smtp_user' => '[email protected]',
'smtp_pass' => 'password',
'mailtype'  => 'html',
#7

[eluser]someone Smile[/eluser]
When I opened phpinfo(), there was OpenSSL supported/enabled, so I think it's working. I have also implemented PHPMailer and tried to send mail, but it was same problem with neverend loading.

EDIT: I've also tried with google credentials which are working good on same production server with wordpress (wp mail smtp).
#8

[eluser]someone Smile[/eluser]
I've finnaly get some errors from both Live and Gmail. I changed ' to " and message to "hello world!". If I try to send message with Live, I get those errors:

Code:
ERROR - 2013-08-05 23:05:28 --> Severity: Notice  --> fwrite(): send of 9 bytes failed with errno=32 Broken pipe /path/to/ci/libraries/Email.php 1846
ERROR - 2013-08-05 23:05:28 --> Severity: Warning  --> stream_socket_enable_crypto(): SSL: Broken pipe /path/to/ci/libraries/Email.php 1703
ERROR - 2013-08-05 23:05:28 --> Severity: Notice  --> fwrite(): send of 24 bytes failed with errno=32 Broken pipe /path/to/ci/libraries/Email.php 1846
ERROR - 2013-08-05 23:05:28 --> Severity: Notice  --> fwrite(): send of 11 bytes failed with errno=32 Broken pipe /path/to/ci/libraries/Email.php 1846
ERROR - 2013-08-05 23:05:28 --> Severity: Notice  --> fwrite(): send of 31 bytes failed with errno=32 Broken pipe /path/to/ci/libraries/Email.php 1846
ERROR - 2013-08-05 23:05:28 --> Severity: Notice  --> fwrite(): send of 25 bytes failed with errno=32 Broken pipe /path/to/ci/libraries/Email.php 1846
ERROR - 2013-08-05 23:05:28 --> Severity: Notice  --> fwrite(): send of 5 bytes failed with errno=32 Broken pipe /path/to/ci/libraries/Email.php 1846
ERROR - 2013-08-05 23:05:28 --> Severity: Notice  --> fwrite(): send of 904 bytes failed with errno=32 Broken pipe /path/to/ci/libraries/Email.php 1846
ERROR - 2013-08-05 23:05:28 --> Severity: Notice  --> fwrite(): send of 2 bytes failed with errno=32 Broken pipe /path/to/ci/libraries/Email.php 1846

And with Gmail:
Code:
ERROR - 2013-08-05 23:09:59 --> Severity: Warning  --> stream_socket_enable_crypto(): SSL: connection timeout /path/to/ci/libraries/Email.php 1703

Before sending those mails I also set smtp_timeout to 20 seconds.

EDIT: There is some additional data from errors which I get it after long loading.
Code:
hello:
There was an SMTP error:
starttls:
There was an SMTP error:
hello:
There was an SMTP error:
Sending of AUTH LOGIN command failed. Error:
from:
There was an SMTP error:
to




Theme © iAndrew 2016 - Forum software by © MyBB