Topic: PunBB sending blank emails

I've recently updated from 1.2 to the latest 1.3.2 and I have problems with emails.
Now, when people wants to register or ask for a new password, they've got the confirmation page saying that an email has been sent, and they receive the email BUT the subject and the content of the email are blank!

This is very urgent to fix!!
Please help.

NB: the forum is http://www.lesardentes.be/forum/

Re: PunBB sending blank emails

Never mind that, your forum is YELLOW!!! AGH!!!!
Just kidding dude, good luck fixing your problem.

Re: PunBB sending blank emails

Mmm... not very helpfull. wink

Re: PunBB sending blank emails

Helpful, no
Friendly, yes
wink

Re: PunBB sending blank emails

Make sure you have the correct files in the lang/mail folder, this is the basic template for them.

Sorry. Unactive due to personal life.

Re: PunBB sending blank emails

Correct answer big_smile
That was the problem.

Thanx.

Re: PunBB sending blank emails

Hello

i have the probleme

I have install French language and i have the folder "mail_templates" but i have this problem blank email !

Re: PunBB sending blank emails

Are the correct files in the folder, do the files have content in them? Do you have french email folder?

Sorry. Unactive due to personal life.

Re: PunBB sending blank emails

Yes it's french folder lang/French/mail_templates/

With englesh files it's ok but not with french ... hmm

10

Re: PunBB sending blank emails

And you have the same number of templates as in the english one? and the french files are correct, like they are for 1.3?

Sorry. Unactive due to personal life.

Re: PunBB sending blank emails

Same for me with German language.

Got the problem with debugging:
Subject an message are "cleaned" with forum_trim (misc.php, line 210-211) which calls utf8_trim in /include/utf8/trim.php.
There, utf8_ltrim and utf8_rtrim use pattern modifier 'u' which treats pattern string as UTF-8.
In German this does not work (because of our great 'umlauts' wink). Should be the same with French accents.
As hotfix, just remove the 'u' modifier at both occurences:

replace

return preg_replace('/^['.$charlist.']+/u','',$str);

with

return preg_replace('/^['.$charlist.']+/','',$str);

and replace

return preg_replace('/['.$charlist.']+$/u','',$str);

with

return preg_replace('/['.$charlist.']+$/','',$str);

in /include/utf8/trim.php.

Note: It's just a quick hotfix for this special problem, I don't now if it could cause (security) problems somewhere else.

Btw, utf8 causes more similar problems. For example, after database update from 1.2.x to 1.3, all users with non-utf8-passwords (as mentioned umlauts, accents etc.) could not log in anymore (bad thing in combination with empty password mails wink).

Re: PunBB sending blank emails

Obviously mail templates have not been saved in UTF-8 encoding. The right way to fix it is to save templates in UTF-8.

There is a similar topic.