Codoforum related discussions
No response when trying to use mail notifications

I have set up codoforum (version 3.3.1) in a hosted environment and am trying (and failing) to have it send out mails using ssl.

My test scenario is the reset password token page.

When I enter a username (or email address) and klick on the "E-mail reset token" button, the ajax loader appears but nothing else happens - no error messages, no email delivery.

mail_type: smtp
smtp_protocol: ssl
smtp_port: [port given by provider]
smtp_username: [username given by provider]
smtp_password: [password given by provider]

I have tested the combination of [password], [username] and [port] with a normal email client and they work fine there.

Any suggestions as to how to solve this?

What are other available options for the value of smtp_protocol that I could test?

Thx.

Update: The solution is to use

smtp_protocol: tls
I have set up codoforum (version 3.3.1) in a hosted environment and am trying (and failing) to have it send out mails using ssl. My test scenario is the reset password token page. When I enter a username (or email address) and klick on the "E-mail reset token" button, the ajax loader appears http://codologic.com/forum/sites/default/themes/default/img/ajax-loader.gif but nothing else happens - no error messages, no email delivery. ```` mail_type: smtp smtp_protocol: ssl smtp_port: [port given by provider] smtp_username: [username given by provider] smtp_password: [password given by provider] ```` I have tested the combination of `[password]`, `[username]` and `[port]` with a normal email client and they work fine there. Any suggestions as to how to solve this? What are other available options for the value of `smtp_protocol` that I could test? Thx. **Update:** The solution is to use ```` smtp_protocol: tls ````
edited Aug 4 '15 at 11:53 am

OK, I have tried to use port 25 instead of the designated SSL port and set smtp_protocolto empty string. Then a mail is delivered, but the reset password page remains the same (ajax loader showing, no response).

So there appear to be several issues here.

Edit: here are the XHR responses

Using port 25 and no ssl:

<b>Notice</b>:  Undefined variable: time in <b>/forum/sys/Controller/Ajax/user/login.php</b> on line <b>109</b><br />
{"status":"success","msg":"E-mail sent successfully"}

Using port 587 and ssl:

<b>Notice</b>:  Undefined variable: time in <b>/forum/sys/Controller/Ajax/user/login.php</b> on line <b>109</b><br />
{"status":"fail","msg":["SMTP connect() failed."]}

So changing $timeto time()in line 109 of the file mentioned fixes the unresponsiveness of the page, which then actually displays the XHR response.

What remains is the original problem of sending mails via ssl.

OK, I have tried to use port 25 instead of the designated SSL port and set `smtp_protocol`to empty string. Then a mail is delivered, but the reset password page remains the same (ajax loader showing, no response). So there appear to be several issues here. **Edit:** here are the XHR responses _Using port **25** and **no** ssl:_ ```` &amp;lt;b&amp;gt;Notice&amp;lt;/b&amp;gt;: Undefined variable: time in &amp;lt;b&amp;gt;/forum/sys/Controller/Ajax/user/login.php&amp;lt;/b&amp;gt; on line &amp;lt;b&amp;gt;109&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt; {&quot;status&quot;:&quot;success&quot;,&quot;msg&quot;:&quot;E-mail sent successfully&quot;} ```` _Using port **587** and ssl:_ ```` &amp;lt;b&amp;gt;Notice&amp;lt;/b&amp;gt;: Undefined variable: time in &amp;lt;b&amp;gt;/forum/sys/Controller/Ajax/user/login.php&amp;lt;/b&amp;gt; on line &amp;lt;b&amp;gt;109&amp;lt;/b&amp;gt;&amp;lt;br /&amp;gt; {&quot;status&quot;:&quot;fail&quot;,&quot;msg&quot;:[&quot;SMTP connect() failed.&quot;]} ```` So changing `$time`to `time()`in line 109 of the file mentioned fixes the unresponsiveness of the page, which then actually displays the XHR response. What remains is the original problem of sending mails via ssl.
edited Jul 27 '15 at 5:21 pm

Hi,

According to the xhr response that you mentioned for port 25, no ssl.

{"status":"success","msg":"E-mail sent successfully"}

The emails are sent successfully.

As for the error, there seems to be some problem.
We will have a look at it.

Hi, According to the xhr response that you mentioned for port 25, no ssl. ``` {&quot;status&quot;:&quot;success&quot;,&quot;msg&quot;:&quot;E-mail sent successfully&quot;} ``` The emails are sent successfully. As for the error, there seems to be some problem. We will have a look at it.

Yep, it works on port 25 with unencrypted connection. I'd really like to get it to work over ssl, though, so I don't have to tell my username and password to anyone willing to intercept the connection.

Yep, it works on port 25 with unencrypted connection. I&#039;d really like to get it to work over ssl, though, so I don&#039;t have to tell my username and password to anyone willing to intercept the connection.
edited Jul 27 '15 at 6:09 pm

Hi,

Are you using SMTP provided by Gmail or your own server ?

Hi, Are you using SMTP provided by Gmail or your own server ?

Neither. As I said, it's a hosted environment. The SMTP server is provided by the hoster and not under my control. Using this SMTP server with an email client like e.g. Apple Mail and with the account info provided by the hoster (username,password, and SMTP-port for SSL) it works fine, thus ruling out that the problems are caused by those values being wrong.

Neither. As I said, it&#039;s a hosted environment. The SMTP server is provided by the hoster and not under my control. Using this SMTP server with an email client like e.g. Apple Mail and with the account info provided by the hoster (`username`,`password`, and `SMTP-port for SSL`) it works fine, thus ruling out that the problems are caused by those values being wrong.
edited Jul 30 '15 at 8:38 am

Hi,

Can you enable the debug option by making the following change:

Open sys/CODOF/Forum/Notification/Mail.php

Around line 60, replace

$mail->SMTPDebug = 0;  // debugging: 1 = errors and messages, 2 = messages only

with

$mail->SMTPDebug = 1;  // debugging: 1 = errors and messages, 2 = messages only

Then, check if you are getting any errors/messages in the response.

Hi, Can you enable the debug option by making the following change: Open sys/CODOF/Forum/Notification/Mail.php Around line 60, replace ``` $mail-&amp;gt;SMTPDebug = 0; // debugging: 1 = errors and messages, 2 = messages only ``` with ``` $mail-&amp;gt;SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only ``` Then, check if you are getting any errors/messages in the response.

I did that. Other than breaking the XHR-response again:

SMTP ERROR: Failed to connect to server:  (0)
SMTP connect() failed.
{"status":"fail","msg":["SMTP connect() failed."]}

this yielded very little further insight.

I did a bit of googling and found this: http://www.beginninglinux.com/home/php/send-plain-text-e-mail-from-php-using-gmail-secure-smtp-server and in there the hint

$mail->SMTPSecure = "tls";

That did the trick.

So in a nutshell, going to Dashboard > Mail Settings > Configuration and setting the value of SMTP Protocol: to tls (or directly in the database in the table codo_config setting smtp_protocol to tls) solves my problem.

I did that. Other than breaking the XHR-response again: ``` SMTP ERROR: Failed to connect to server: (0) SMTP connect() failed. {&quot;status&quot;:&quot;fail&quot;,&quot;msg&quot;:[&quot;SMTP connect() failed.&quot;]} ``` this yielded very little further insight. I did a bit of googling and found this: http://www.beginninglinux.com/home/php/send-plain-text-e-mail-from-php-using-gmail-secure-smtp-server and in there the hint ```` $mail-&amp;gt;SMTPSecure = &quot;tls&quot;; ```` That did the trick. So in a nutshell, going to `Dashboard &amp;gt; Mail Settings &amp;gt; Configuration` and setting the value of `SMTP Protocol:` to `tls` (or directly in the database in the table `codo_config` setting `smtp_protocol` to `tls`) solves my problem.
429
7
3
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft