External SMTP Server

Permalink 1 user found helpful
I'm having trouble getting the form block to send e-mail.

When I attempt to send a response from the form block I don't get any email but do get two entries in the log.

One entry is log type "sent emails." It looks successful and starts like this:
"**EMAILS ARE ENABLED. THIS EMAIL WAS SENT TO mail()**"

The other entry is log type "exception". It looks unsuccessful and starts like this:
"Mail Exception Occurred. Unable to send mail: Could not open socket"

I'm using concrete5 version 5.4.1.1, XAMPP 1.7.4, Windows 7 am using google apps for SMTP mail.

I've tried many combinations unsuccessfully. Here's the one I most think should work, but doesn't.

In Dashboard > Sitewide Settings > Email > Sitewide Mail Settings I've done the following.

Selected External SMTP Server
Mail Server: smtp.gmail.com (I've tried smtp.googlemail.com)
Connection Type: SSL
Port: 465

These SMTP settings work in my email client (Thunderbird) from the same server.

Server Name: smtp.googlemail.com
Port: 465
User: [email protected]
Authentication method: Normal password
Connection Security: SSL/TLS

I'm not running a local SMTP server. XAMPP control panel reports SMTP service is disabled. But I suspect this isn't needed since I'm not running a local SMTP server. Correct?

I turned off the local firewall for testing. I opened port 465 on my router.

I had this working before on a older versions of concrete5, xampp, a different router, but can't for the life of me figure out what I'm doing wrong this time.

koeg
View Replies: View Best Answer
clintre replied on at Permalink Reply
clintre
XAMPP may not be allowed by the Windows 7 firewall to send out through port 465. Having not used XAMPP in many years, I do not know for a fact if that is the case. Just a thought. You may want to look at the XAMPP support for sending out to gmail servers.
koeg replied on at Permalink Reply
koeg
I'm pretty sure 465 is open. I've turned off the software firewall and configured my router to pass traffic on that port to/from my web server.

Thanks for the suggestion, though.
koeg replied on at Permalink Reply
koeg
I'm pretty sure 465 is open. I've turned off the software firewall and configured my router to pass traffic on that port to/from my web server.

Thanks for the suggestion, though.
Brainakazariua replied on at Permalink Reply
Brainakazariua
I think the problem is that the mails get send from a different account.
by default the admin account mail adres get used, you can use a different one by adding these lines to your site.php:

define('FORM_BLOCK_SENDER_EMAIL', [email protected]');
define('EMAIL_ADDRESS_FORGOT_PASSWORD', [email protected]');
koeg replied on at Permalink Reply
koeg
By admin account, you meant my concrete5 admin account mail address, right? Not my google apps admin account.

So I tried two things.

First, I didn't implement those two lines of code. I just aligned all my accounts. In my c5 dashboard e-mail settings, I used my c5 admin e-mail account, and I changed the form block to e-mail that same e-mail address--let's call it [email protected] That didn't work.

Second, I added those lines of code exactly like you have it (changing out "yourdomain"), then changed the form block to e-mail to send to that same e-mail address. However, I left the dashboard e-mail settings as [email protected] That didn't work.

Thanks for the suggestion. I suspect that'll help me further down the road, but that didn't seem to help with my current problem.
nteaviation replied on at Permalink Reply
nteaviation
I would bet you need to have the openssl php module loaded to do ssl/tls. If T-Bird will connect then it does not sound like a network issue.
koeg replied on at Permalink Reply
koeg
How do I do that?

I have this in my httpd.conf

LoadModule ssl_module modules/mod_ssl.so
Include "conf/extra/httpd-ssl.conf"

Thanks for your response.
nteaviation replied on at Permalink Best Answer Reply 1 Attachment
nteaviation
That is for the Apache SSL support. PHP has it's own module. A phpinfo() is the easiest way to check it is loaded properly. My phpinfo lookes like this, see attached (mine may be a little different because I am running Linux)
nteaviation replied on at Permalink Reply
nteaviation
I can't get port 465 to work from my desktop. Try port 587. You can test a connection using telnet from the DOS prompt. Try:
telnet smtp.gmail.com 587

You should see a prompt back from gmail like:
220 mx.google.com ESMTP p8sm1729619vcr.42

Then enter:
EHLO mail.mydomain.com

You should see:
250-mx.google.com at your service,
250-SIZE 35651584
250-8BITMIME
250-STARTTLS
250 ENHANCEDSTATUSCODES
koeg replied on at Permalink Reply
koeg
I'm pretty sure my port 465 is open because my e-mail client (Thunderbird) seems to be happy with it.

But for giggles, I checked out the telent suggestion. Oddly enough, I got similar results to you when I tried 587, but not when I tried 465 (erratic behavior with the cursor and no text back).

This just makes me wonder if the telnet server at smtp.gmail.com is enabled for 587, but not 465.

I'm not sure what this all means, but I don't immediately see how this is relevant to my problem. I think I'll call this one a red herring for now. But thanks for the suggestion.
koeg replied on at Permalink Reply
koeg
It's fixed. The openssl package was not enabled in PHP. I added this one line to my php.ini file and everything magically worked.

extension=php_openssl.dll

I didn't otherwise need to install any packages or anything. The standard XAMPP and concrete5 bundles work nicely.

I'm not sure, but I believe that line was in older versions of XAMPP. Given that they enable openssl in Apache, I'm not sure why they wouldn't include it in php.ini--or at least have a commented line.

Anyway, it works perfectly. Thank you so much for your help all, especially nteavaiation!
nteaviation replied on at Permalink Reply
nteaviation
Fantastic! Glad you got it resolved. You are very welcome, sometimes I get lucky :)