[Solved] Sending emails from my phpBB board fails

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
Shadow_SHD
Registered User
Posts: 12
Joined: Sun May 19, 2019 7:46 am

[Solved] Sending emails from my phpBB board fails

Post by Shadow_SHD »

Hi,

Sorry if my english is bad, I'm french :)

I bought my domain name last 1st may to a french provider, Online.net.
It is a cheap shared web hosting service choosed and used for learning purposes.

My provider offers an application installation service so I installed phpBB v3.1.9 and updated to 3.2.7, with a PHP v7.2 database.

The SRT :

Support Request Template
What version of phpBB are you using? phpBB 3.2.7
What is your board's URL? (can give access if necessary)
Who do you host your board with? Online.net
How did you install your board? I used a tool provided by my host
What is the most recent action performed on your board? Update from a previous version of phpBB3
Is registration required to reproduce this issue? Yes
Do you have any MODs installed? No
Do you have any extensions installed? Yes
What version of phpBB3 did you update from? phpBB 3.2.7
What extensions do you have installed? Best Answer, Copyright in footer, Download System, Editor extension, Forum Icons, Header Banner, Modbreak, Pages, Partner Page, phpBB Topic Prefixes, Posts merging, smilies scroll box, Thanks for posts, Topic Author, Upload Extensions, VigLink
What styles do you currently have installed? proflat
What language(s) is your board currently using? French
Which database type/version are you using? MySQL 5
What is your level of experience? New to PHP and phpBB
What username can be used to view this issue? No answer given
What password can be used to view this issue? No answer given
What actions did you take (updating your board; installing a MOD, style or extension; etc.) prior to this problem becoming noticeable? The problem exists still the initial setup.
Please describe your problem. Sending emails from my phpBB board lands to an email error occurred in the PCA and no mail is sent.
Generated by SRT Generator

So the issue is that trying to send an email from the board or from the ACP leads to an Email error occurred in the ACP log.
Here's a screenshot :

Image

I don't use SMTP so Use SMTP server is set to No in the ACP.

I have contacted my host who made me test the PHP mail() function with a script uploaded to my website and it is working good.
I've tried with Gmail SMTP settings and it's working good too.

But what a pity to pay for a domain name and use another mail provider :(

I'm a beginner in PHP / phpBB world but have good Javascript knowledges, so what I'm going to write may be wrong and/or the last thing to do, but I achieved to make mails working good in phpBB by adding a line in a php file.

I tried to understand why PHP mail() function works with a script but not in phpBB, so I took a look at the includes/functions_messenger.php file and
added this line at line 634 :

Code: Select all

$mail_to = $which_ary['email'];
Just before the line :

Code: Select all

$result = phpbb_mail($mail_to, $this->subject, $this->msg, $headers, PHP_EOL, $err_msg);

It seems that for some reason the $mail_to variable isn't understood by my host service and generates the error in the ACP.
But using $which_ary['email'] instead does solve my issue and emails are sent.

So I post this message to try to know if the problem is relative to my host and there is nothing we can do about it, or if it may be solved with an update of functions_messenger.php file ?

I'm ready to make further tests.

Thank you and have a nice day ;)
Last edited by Shadow_SHD on Mon May 11, 2020 6:48 am, edited 1 time in total.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26505
Joined: Fri Aug 29, 2008 9:49 am

Re: Sending emails from my phpBB board fails

Post by Mick »

Hello welcome to phpBB.com
Shadow_SHD wrote: Sun May 19, 2019 8:26 am What is your board's URL? (can give access if necessary)
How did you install your board? I used a tool provided by my host
A link to the board is always useful, it saves asking a lot of questions such as “is this a new installation?”. It’s often handy to know the state of your board (is it new, is it old, are there a million posts etc.)

You shouldn’t use host supplied one-click installers/updaters, they may be simpler in the beginning but are inherent with problems as can be see seen from many hundreds of topics on this site. On top of which the code isn’t ours so we can’t fully support it, your host should be helping you with their software but I don’t suppose they can. You should use the files from here.

Have you seen Knowledge Base - EMAIL - Easy setup (NOT SMTP)? It may help. If not can you post a screencap of your email settings please?
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
Shadow_SHD
Registered User
Posts: 12
Joined: Sun May 19, 2019 7:46 am

Re: Sending emails from my phpBB board fails

Post by Shadow_SHD »

Hi Mick, thanks for your answer.

The URL is https://www.pincabpassion.fr/forum.
Test account :
- User : test
- Password : 123456

The board is 15 days old and is mainly used to make test and learn web hosting / own forum making ; our main board is hosted by ForumActif (= ForumMotion) and we're looking at an eventual possibility to move to our own server.

I've read the KB as well as many topics about email errors, and triple checked my settings. Here's a screenshot :

Image

I'm going to make a new test board with manual installation to see if it helps.
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26505
Joined: Fri Aug 29, 2008 9:49 am

Re: Sending emails from my phpBB board fails

Post by Mick »

Thanks for the information.
Shadow_SHD wrote: Sun May 19, 2019 9:28 amI'm going to make a new test board with manual installation to see if it helps.
Ok, good suggestion.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 5871
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Sending emails from my phpBB board fails

Post by thecoalman »

Check the server log, it should be available from the hosting control panel.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
Shadow_SHD
Registered User
Posts: 12
Joined: Sun May 19, 2019 7:46 am

Re: Sending emails from my phpBB board fails

Post by Shadow_SHD »

My server log when trying to send an email :

Code: Select all

#LogCenter file last modification: 2019-05-19 08:51:28
<my_domain>:<my_IP> - - [19/May/2019:08:52:22 +0200] "POST /forum/adm/index.php?i=acp_board&sid=2fecfc52af1dca5cea2598f8e29b994e&mode=email HTTP/1.0" 200 3201 "https://<my_domain>/forum/adm/index.php?sid=2fecfc52af1dca5cea2598f8e29b994e&i=acp_board&mode=email" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15"
<my_domain>:<my_IP> - - [19/May/2019:08:52:27 +0200] "GET /forum/adm/index.php?sid=2fecfc52af1dca5cea2598f8e29b994e&i=25 HTTP/1.0" 200 4278 "https://<my_domain>/forum/adm/index.php?i=acp_board&sid=2fecfc52af1dca5cea2598f8e29b994e&mode=email" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15"
<my_domain>:<my_IP> - - [19/May/2019:08:52:27 +0200] "GET /forum/adm/images/gradient2b.gif HTTP/1.0" 200 439 "https://<my_domain>/forum/adm/index.php?sid=2fecfc52af1dca5cea2598f8e29b994e&i=25" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15"
<my_domain>:<my_IP> - - [19/May/2019:08:52:28 +0200] "GET /forum/adm/index.php?sid=2fecfc52af1dca5cea2598f8e29b994e&i=acp_logs&mode=critical HTTP/1.0" 200 3674 "https://<mon_domaine>/forum/adm/index.php?sid=2fecfc52af1dca5cea2598f8e29b994e&i=25" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15"
As I can have only one database I'm actually doing backups of everything before attempting a fresh new manual install.
User avatar
EA117
Registered User
Posts: 2158
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Sending emails from my phpBB board fails

Post by EA117 »

You're certainly welcome to do it anyway, but I don't expect any difference from "installing phpBB a different way." All the evidence thus far is pointing to the mail configuration of both phpBB and the hosting provider, and not "this has something to do with the way phpBB was installed." Whether you re-install or not, I expect the next action that moves you closer to solving the problem is to dig into what is actually happening.
Shadow_SHD wrote: Sun May 19, 2019 8:26 am I tried to understand why PHP mail() function works with a script but not in phpBB, so I took a look at the includes/functions_messenger.php file and added this line at line 634 :

Code: Select all

$mail_to = $which_ary['email'];
Just before the line :

Code: Select all

$result = phpbb_mail($mail_to, $this->subject, $this->msg, $headers, PHP_EOL, $err_msg);
It seems that for some reason the $mail_to variable isn't understood by my host service and generates the error in the ACP.
But using $which_ary['email'] instead does solve my issue and emails are sent.
Effectively what I expect out of that change is that you're changing From: "Staff Pincab Passion" <[email protected]> into simply From: [email protected]. I don't know if the PHP mail testing script provided a way to test specifying a "display name" for the email address such as that, but perhaps it would have failed through the testing script as well.

I see where functions_messenger.php actually would have automatically done exactly this kind of change (made the "To" address have a blank "name" member) if it thought the PHP and sendmail process would be used on a server running Windows rather than Linux. (Line 93) So apparently there are other situations in which the "display name" isn't tolerated, and maybe the sendmail on your hosting service doesn't accept it even if its running on Linux (which we assume it probably is).

If that were happening to me, I would also try temporarily changing my "Contact name:" from "Staff Pincab Passion" to something shorter and without spaces, such as simply "Staff". Just to see if that made any difference when trying to send with a "display name" specified for the email address.

It also comes to mind that maybe the sendmail is rejecting the forced MIME encoding of the display name; which would be expected within the SMTP headers for sure, but possibly not on the sendmail parameters. You could test that point by leaving your "Contact name:" as "Staff Pincab Passion", but then change line 614 from:

Code: Select all

${$type} .= ((${$type} != '') ? ', ' : '') . (($which_ary['name'] != '') ? mail_encode($which_ary['name'], $encode_eol) . ' <' . $which_ary['email'] . '>' : $which_ary['email']);
to instead be:

Code: Select all

${$type} .= ((${$type} != '') ? ', ' : '') . (($which_ary['name'] != '') ? $which_ary['name'] . ' <' . $which_ary['email'] . '>' : $which_ary['email']);
Meaning, remove the mail_encode() function call that is wrapping the display name. Because more literally, what's actually in the $mail_to value is From: "=?UTF-8?B?U3RhZmYgUGluY2FiIFBhc3Npb24=?=" <[email protected]>, with a forced MIME encoding of the display name. Skipping the MIME encoding is expected to be fine in this case, since your display name is "Staff Pincab Passion" and not something which requires UTF-8 or MIME encoding in order to safely represent anyway.
Shadow_SHD
Registered User
Posts: 12
Joined: Sun May 19, 2019 7:46 am

Re: Sending emails from my phpBB board fails

Post by Shadow_SHD »

I can't manually install phpBB as I got a max_user_connections error message at 54%, the hosting service we choosed limit is set at 3 max connections at the same time to the database.

That's why I'm stuck with the application service to install phpBB 3.1.9 and then update to 3.2.7.
I cannot choose a better hosting formula as I'm not the founder of the original forum but the technician as it's my real life job.

I've just tried to clear my database and my forum/ folder by FTP after a backup and initiate a manual install from my host's console.
It placed the phpBB 3.1.9 files in the forum/ folder, I replaced them with 3.2.7 files but still get the max_user_connections error.

So I let a fresh new 3.1.9 install done and immediately test to send an email : same Email error in the ACP log.

I agree with you EA117, there's no difference at all. I have followed your advices and :
- Changed Staff Pincab Passion to Staff then no input at all : no changes.
- Changed line 614 : no changes.

Now I'm trying to restore my backups but I'm facing a blank page when browsing to pincabpassion.fr/forum :roll: :mrgreen:
User avatar
EA117
Registered User
Posts: 2158
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Sending emails from my phpBB board fails

Post by EA117 »

Shadow_SHD wrote: Sun May 19, 2019 3:21 pm - Changed Staff Pincab Passion to Staff then no input at all : no changes.
- Changed line 614 : no changes.
Hard to say what the sendmail is really rejecting then, since the only thing that works for you is "From: [email protected]".

I believe what thecoalman was suggesting earlier was to try and consult logging being generated by the actual sendmail processing, rather than the Apache web server logging that you showed. I doubt that this particular logging is available to you already, but talking with your hosting provider and asking for whatever diagnostic or logging they can provide for why sendmail (or whatever mailing process they have configured PHP to invoke on your hosting account) rejected the send attempt that was initiated by phpBB. e.g. Something that confirms it's some enhanced security check rejecting the attempt to send, maybe something generic like "parameters invalid", or similar.

i.e. Note you're not saying it's your hosting provider's problem to fix, which will be important to acknowledge since they know the test PHP script worked. But you need their help to know what condition the sendmail process encountered which caused it to return failure back to the PHP mail() function, at least in the cases where phpBB is calling it with From: "Staff Pincab Passion" <[email protected]>.


The other approach to put on the table would be to enable SMTP in phpBB, but not through an external provider like GMail. Simply enable phpBB to use SMTP directly, using "localhost" as the server address, and the standard port 25, authentication set to "plain", but simply leave username and password blank.

What you're expecting is that this effectively "ends up using the same mail sending facilities that invoking PHP mail() would have used" (although whether that's true still depends on the hosting provider's configuration), but now phpBB is what's responsible for constructing the entire SMTP session and communicating it to an SMTP server (which is simply the mail process on the local hosting server).

Having done this, the possibilities now include "it might simply work at that point", because we avoided some still-unknown issue trying to pass the "From:" parameter through PHP mail(), and instead sent it through SMTP. Or maybe, you'll actually now get a more specific error and session log in the phpBB ACP error log, because phpBB is able to verbosely report the SMTP session results during failure.

Shadow_SHD wrote: Sun May 19, 2019 3:21 pm Now I'm trying to restore my backups but I'm facing a blank page when browsing to pincabpassion.fr/forum
The Apache error log (which might be available to you as a file visible through FTP, or might be something you'll have to view in your hosting control panel) should have a specific technical reason for the 500 response. e.g. A directory that couldn't be accessed, a conflicting configuration, a PHP runtime failure, etc. If the latest content of that log doesn't already point you in the right direction, post it here and we might be able to suggest what's still not quite right after restoring backups of the file system and database.

Note that's not the Apache log you included in your previous post, which was the Apache access log, rather than the error log.
Shadow_SHD
Registered User
Posts: 12
Joined: Sun May 19, 2019 7:46 am

Re: Sending emails from my phpBB board fails

Post by Shadow_SHD »

Thanks for your help EA117, I really appreciate ;)

For now I try to set the board back to life, it may be useful to tell how I've done the backups :

- In MyPHPAdmin I selected the database db345746_pincabpassion and did a fast export to SQL format. A db345746_pincabpassion.sql file was then downloaded on my Mac drive.

- With my FTP client (Transmit) I selected all files and directories of my www/forum folder to a backup folder on my Mac drive.

- In MyPHPAdmin I selected all tables in db345746_pincabpassion and deleted them.

- In my host console I initiated a new phpBB install then tested the email function that didn't work (Email error in ACP).

- In Transmit I deleted all files and folders in www/forum then put back all files and folders from my backup.

- In PHPMyAdmin I selected all new tables in db345746_pincabpassion then deleted them. Then I imported the db345746_pincabpassion.sql file back and checked all tables, PHPMyAdmin reported them as good.

At this point browsing to /forum/ leads to a blank page, and trying to /forum/install leads to the welcome screen and when I click on the Update page I get a blank screen again. The few tests scripts I have in /forum/ leads to a blank screen too.

The error log :

Code: Select all

apache2[4]: [autoindex:error] [pid 4:tid 140107109615360] [client <my_IP>:47595] AH01276: Cannot serve directory /flex/storage/pincabpassion.fr/site/www/forum/pptools/formulaire/: No matching DirectoryIndex (index.html,index.php,index.php5,index.php4,index.php3,index.xhtml,index.htm,index.shtml,default.htm) found, and server-generated directory index forbidden by Options directive
Thanks ;)

Edit : I've put back a phpBB 3.1.9 backup and can access the board and ACP. Still digging :D

Edit : OK, I've put back my 3.2.7 backup then replaced the /phpbb/ folder with the one of the install archive and the board seems alive again :mrgreen:

Edit : I've just tried the localhost:25 SMTP setup and get :

Code: Select all

Email error
» EMAIL/SMTP
/forum/adm/index.php

Could not connect to smtp host : 111 : Connection refused

Errno 2: stream_socket_client(): unable to connect to localhost:25 (Connection refused) at [ROOT]/includes/functions_messenger.php line 1192
User avatar
EA117
Registered User
Posts: 2158
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Sending emails from my phpBB board fails

Post by EA117 »

Shadow_SHD wrote: Sun May 19, 2019 4:29 pm - With my FTP client (Transmit) I selected all files and directories of my www/forum folder to a backup folder on my Mac drive.
...
- In Transmit I deleted all files and folders in www/forum then put back all files and folders from my backup.
You may have already accounted for it, but one thing to ensure with an FTP-based transfer is that the files are being transferred in binary mode, rather than allowing ASCII mode to apply to some of the files. Not that a 500 error from the Apache server is what outcome seems likely for file(s) that were corrupted by ASCII transfer; I'm just commenting on the backup and restore process in general.

Shadow_SHD wrote: Sun May 19, 2019 4:29 pm - In MyPHPAdmin I selected all tables in db345746_pincabpassion and deleted them.

- In my host console I initiated a new phpBB install then tested the email function that didn't work (Email error in ACP).
...
- In PHPMyAdmin I selected all new tables in db345746_pincabpassion then deleted them. Then I imported the db345746_pincabpassion.sql file back and checked all tables, PHPMyAdmin reported them as good.
There is at least potential for an issue there, because "initiated a new phpBB install" (via the hosting service's installation method) may possibly involve creating a new database user and/or password. And restoring your previously-downloaded files will be restoring a config.php that describes the old database user and password.

So if taking that approach again in the future, perhaps compare the newly-created config.php against the backup copy, and see if the credential information actually is still the same. You can also simply keep the installer-created config.php when removing the other files, same as you would during any 3.1.x to 3.2.x upgrade. Since the installer-created config.php "is correct for accessing the currently-created database", regardless of whether the database user information changed or not.

Shadow_SHD wrote: Sun May 19, 2019 4:29 pm

Code: Select all

apache2[4]: [autoindex:error] [pid 4:tid 140107109615360] [client <my_IP>:47595] AH01276: Cannot serve directory /flex/storage/pincabpassion.fr/site/www/forum/pptools/formulaire/: No matching DirectoryIndex (index.html,index.php,index.php5,index.php4,index.php3,index.xhtml,index.htm,index.shtml,default.htm) found, and server-generated directory index forbidden by Options directive
That is an Apache error log, which is what we wanted to see. That particular error doesn't look like something that happened in response to serving phpBB's index.php, though. As though maybe this isn't the current error log. Perhaps check the time stamp on that file. As well as look in the PHP information displayed by your hosting control panel or the phpBB "PHP Info" page, to see what the "error_log" file name configuration might be set to. The hosts implementation of PHP may be separate from Apache and/or putting the PHP errors in a different log file.

So I don't think we're looking at the reason why the current /forum directory comes up as blank / status 500, yet.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 5871
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Sending emails from my phpBB board fails

Post by thecoalman »

Shadow_SHD wrote: Sun May 19, 2019 1:16 pm My server log when trying to send an email :
That is from the access log, you need to look at the error log.

------edit-----

Ooops I see that was already pointed out.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
Shadow_SHD
Registered User
Posts: 12
Joined: Sun May 19, 2019 7:46 am

Re: Sending emails from my phpBB board fails

Post by Shadow_SHD »

EA117 wrote: Sun May 19, 2019 6:05 pmone thing to ensure with an FTP-based transfer is that the files are being transferred in binary mode, rather than allowing ASCII mode
I've just setup Transmit to always transfer in binary mode. I guess a file was transferred in ASCII mode and caused the board showing a blank page.
EA117 wrote: Sun May 19, 2019 6:05 pmmay possibly involve creating a new database user and/or password.
So if taking that approach again in the future, perhaps compare the newly-created config.php against the backup copy, and see if the credential information actually is still the same.
My hosting formula allows one database only, so eventual new config.php will always contains the same credentials.
EA117 wrote: Sun May 19, 2019 6:05 pmAs well as look in the PHP information displayed by your hosting control panel or the phpBB "PHP Info" page, to see what the "error_log" file name configuration might be set to.
You can read the whole PHP info > here <.

That's curious that in PHP Info SMTP and SMTP port are localhost and 25, and setting these values in ACP leads to a connection error. Maybe it's normal ?

Also we can read that mail.log and sendmail_from are set to no value, that could explain that email errors aren't logged and From generates the error ? Just guessing...

I've just took a look in the error file after trying to send an email via the ACP and there's nothing about an email error.
So I guess I have to ask my host support, but I imagine what they'll tell me : the PHP mail() works good and if it doesn't work with phpBB please ask phpBB support :(
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26505
Joined: Fri Aug 29, 2008 9:49 am

Re: Sending emails from my phpBB board fails

Post by Mick »

As long as you have the host installed board expect problems, your board isn’t that big can’t you just start again and install properly? The bottom line is you’re using your hosts software and support should be down to them.

I notice Cookie secure is disabled which needs to be enabled if you’re using ssl.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
User avatar
EA117
Registered User
Posts: 2158
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: Sending emails from my phpBB board fails

Post by EA117 »

Shadow_SHD wrote: Mon May 20, 2019 7:46 am You can read the whole PHP info > here <.
...
Also we can read that mail.log and sendmail_from are set to no value, that could explain that email errors aren't logged and From generates the error ? Just guessing...
The PHP "error_log" configuration is set to the reserved "syslog" value, which means the PHP errors aren't going directly to any file, and a instead are part of the Linux system logs. That's going to be no fun at all for diagnosing whenever your server has a PHP runtime error. I'd ask my host whether its possible for me to see those logs from my hosting control panel, else whether it's possible to set this PHP configuration to drop errors into a file you'll be able to see through FTP.
Shadow_SHD wrote: Mon May 20, 2019 7:46 am That's curious that in PHP Info SMTP and SMTP port are localhost and 25, and setting these values in ACP leads to a connection error. Maybe it's normal ?
Those are the default values for PHP, so their presence doesn't necessarily mean "your hosting service expected those should be working." The phpBB application, specifically, doesn't rely on those PHP settings, and simply has its own configuration page in the ACP for those values.

If putting those "localhost" and "25" values into the phpBB SMTP email configuration is logging a "unable to create connection"-type error in the phpBB ACP error log, it could mean the hosting server simply doesn't have a local SMTP service we can use this way, or else they're running it on a different non-default port.

That too could be in your list of questions to the hosting provider: "If my non-PHP application wanted to send mail though the local server, what is the SMTP configuration I could set in that application?"
Shadow_SHD wrote: Mon May 20, 2019 7:46 am So I guess I have to ask my host support, but I imagine what they'll tell me : the PHP mail() works good and if it doesn't work with phpBB please ask phpBB support :(
And let's be fair, they're "not wrong." That was really the intention behind saying earlier "it's not that we're saying it's their problem to solve" when talking to the hosting support, since they did already have you use the PHP test script and sending worked. And you did already figure out a huge variable that few would have known to guess: the phpBB mail sending works if you limit it to using To: [email protected] without including the display name.

But they are still your hosting support, and these configurations (where are my PHP errors going, what are my mail sending possibilities from an application running on my hosting account other than PHP mail(), etc.) are still things "only they know" and are the information you'll still need to understand or figure out the solutions. So you're trying to work "with them"; where they provide the information that only they may have access to, and you are trying to solve the actual problem.

e.g. Right now it's impossible for you to say why attempting to invoke sendmail though PHP mail() has rejected the To: "Staff Pincab Passion" <[email protected]> sending address, but presumably someone at their end actually does have access to the logging that would confirm why that is. Even though they would still assert "but that's phpBB's problem to solve" / your problem to solve by changing the $mail_to value as you have.


Seeing my writing from yesterday I realize I fixated on saying From: instead of To:, but of course what your modification of the $mail_to variable changes is the To: address passed to the PHP mail() function. The expected difference -- that setting $mail_to the way you are has eliminated the possibility to include a display name -- is still correct.

But in the case of To: it's not actually the "Contact name:" that is being included (which is an additional reason why changing that had no effect), and it's actually the phpBB account name which is "the display name" for the To: email address.

Perhaps confirming what the actual effect of the $mail_to variable change would be appropriate, just to make sure there isn't some other difference in addition, or instead, that reviewing the code didn't illuminate. A simple way to confirm this might be to add a var_dump() on the value before and after the change, such as:

Code: Select all

				var_dump( $mail_to );
				$mail_to = $which_ary['email'];
				var_dump( $mail_to );
				$result = phpbb_mail($mail_to, $this->subject, $this->msg, $headers, PHP_EOL, $err_msg);
Which, such as in the case of the ACP "Send test email", would put output similar to:

Code: Select all

string(15) ""=?UTF-8?B?U3RhZmYgUGluY2FiIFBhc3Npb24=?=" <[email protected]>", string(15) "[email protected]"
...at the top of the page confirming "The test email has been sent." Cut-n-paste whatever that output is at the top of the page, though feel free to obfuscate the email address so we don't give spammers more mailto: links than they deserve when reading this discussion.
Post Reply

Return to “[3.2.x] Support Forum”