3

I can't get email to work for my site. I'd appreciate any help at all on it. I don't care which of the three methods work just so long as it works.

This is a brand new site with one email box. I don't plan on checking the email at that box or using it in any other way than to send emails to an admin so she can check when new entries are added.

When I try using php email or sendmail, the control panel says that the email has been sent but I never receive it (not in my junk folder either). Same with the email test php file in the utilities folder - it says there are no php errors and that the email was sent.

When I try to use SMTP, I get lots of errors (below). Here are my settings for that:

$config['mail_protocol'] = 'smtp';

$config['smtp_server'] = 'ssl://mail.[mydomain].com:587';

$config['smtp_username'] = 'postmaster@[mydomain].com';

$config['smtp_password'] = '[password]';

$config['smtp_crypto'] = 'tls';

$config['email_newline'] = "\r\n";

$config['email_crlf'] = "\r\n";

(my hosting provider told me to use port 587 and tsl.)

And here are the errors:

A PHP Error was encountered Severity: Warning Message: fsockopen(): SSL operation failed with code 1. OpnSSL Error messages: error:140770FC:SSL routines:func(119):reason(252) Filename: libraries/Email.php Line Number: 1675

A PHP Error was encountered Severity: Warning Message: fsockopen(): Failed to enable crypto Filename: libraries/Email.php Line Number: 1675

A PHP Error was encountered Severity: Warning Message: fsockopen(): unable to connect to ssl:/mail.[mydomain].com:587:25 (Unknown error) Filename: libraries/Email.php Line Number: 1675

A PHP Error was encountered Severity: Warning Message: fwrite() expects parameter 1 to be resource, boolean given Filename: libraries/Email.php Line Number: 1818

A PHP Error was encountered Severity: Warning Message: fgets() expects parameter 1 to be resource, boolean given Filename: libraries/Email.php Line Number: 1841

A PHP Error was encountered Severity: Warning Message: fwrite() expects parameter 1 to be resource, boolean given Filename: libraries/Email.php Line Number: 1818

A PHP Error was encountered Severity: Warning Message: fgets() expects parameter 1 to be resource, boolean given Filename: libraries/Email.php Line Number: 1841

A PHP Error was encountered Severity: Warning Message: fwrite() expects parameter 1 to be resource, boolean given Filename: libraries/Email.php Line Number: 1818

A PHP Error was encountered Severity: Warning Message: fgets() expects parameter 1 to be resource, boolean given Filename: libraries/Email.php Line Number: 1841

A PHP Error was encountered Severity: Warning Message: fwrite() expects parameter 1 to be resource, boolean given Filename: libraries/Email.php Line Number: 1818

A PHP Error was encountered Severity: Warning Message: fgets() expects parameter 1 to be resource, boolean given Filename: libraries/Email.php Line Number: 1841

A PHP Error was encountered Severity: Warning Message: fwrite() expects parameter 1 to be resource, boolean given Filename: libraries/Email.php Line Number: 1818

A PHP Error was encountered Severity: Warning Message: fwrite() expects parameter 1 to be resource, boolean given Filename: libraries/Email.php Line Number: 1818

A PHP Error was encountered Severity: Warning Message: fgets() expects parameter 1 to be resource, boolean given Filename: libraries/Email.php Line Number: 1841

An Error Was Encountered Unable to send email at this time.

The following SMTP error was encountered: 0

Unable to send data: AUTH LOGIN

Failed to send AUTH LOGIN command. Error:

Unable to send data: MAIL FROM:

from:

The following SMTP error was encountered:

Unable to send data: RCPT TO:

to:

The following SMTP error was encountered:

Unable to send data: DATA

data:

The following SMTP error was encountered:

Unable to send data: User-Agent: ExpressionEngine 2.5.5 Date: Fri, 8 Mar 2013 10:45:46 -0500 From: Return-Path: To: [email protected] Subject: test3 Reply-To: "postmaster@[mydomain].com" X-Sender: postmaster@[mydomain].com X-Mailer: ExpressionEngine 2.5.5 X-Priority: 3 (Normal) Message-ID: <513a07aa3bc58@[mydomain].com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit test

Unable to send data: .

The following SMTP error was encountered:

Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

2
  • how can we handle these type of error???????????????????? 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.
    – anduye
    Commented Dec 27, 2018 at 13:26
  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review Commented Dec 30, 2018 at 23:14

3 Answers 3

2

I think it's the port number in your smtp_server. I believe that parameter is only looking for ssl://your.host.name. You should add the port number separately:

$config['email_smtp_port'] = 587;
1
  • Hey Rob, thanks for the tip but that gives the same errors.
    – Chego
    Commented Mar 8, 2013 at 20:40
1

This turned out to be a problem with local delivery set on the server. We started the hosting account with our main domain name and so it was not allowing me to send email to that domain. Once the host turned that off, it fixed everything and I could use phpmail.

-1

try to change $config['smtp_server'] = 'ssl://mail.[mydomain].com:587'; ...to... $config['smtp_server'] = 'tls://mail.[mydomain].com:587';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.