Hello!
When receiving the mail that notify me a form submission I get a human unreadable BASE64 encoded text.
I've tested to send a simple mail with phpmail and it arrives correctly.
I report a mail that came from my Concrete5 site:
Content-type: text/plain; charset=UTF-8
From:<!!MY_REMOVED_E-MAIL_ADDRESS!!>
Mime-Version:1.0
Content-Transfer-Encoding: BASE64
CkUnIHN0YXRvIGludmlhdG8gaWwgZm9ybSBSaWNoaWVzdGEgaW5mb3JtYXppb25pIHRyYW1pdGUg
aWwgdHVvIHNpdG8gQ29uY3JldGU1LgoKRW1haWwgcGVyc29uYWxlDQpoZW5yaWsuc296em
ETC, ETC, ETC (I've removed the other base64 lines)
The simple script I've successfully used to test phpmail was this:
<?phperror_reporting(E_ALL);$mail_from="postmaster@!!MY_REMOVED_DOMAIN!!";$mail_subject="Testing e-mail";$mail_text="Questa è una e-Mail di test inviata dal servizio Hosting di Aruba.it per la verifica del corretto funzionamento di PHP mail()function .
Aruba.it";$mail_to="!!MY_REMOVED_E-MAIL!!";if(mail($mail_to,$mail_subject,$mail_text,"From: {$mail_from}\r\n")){echo"Mail inviata correttamente !<br><br>Questo di seguito è il codice sorgente usato per l'invio della mail:<br><br>";highlight_file($_SERVER["SCRIPT_FILENAME"]);unlink($_SERVER["SCRIPT_FILENAME"]);}elseecho"<br><br>Recapito e-Mail fallito!";?>
Can anyone give me an advice on how to fix this?
Thank you,
Henrik
Yeah got that here to now and notified the IT department here. What his problem seemed to be was that the main email server doesn't know BASE64 decoding, he rerouted it to the INTRANET server and that works. Temporary solution tho...
I debugged the incriminated file: mail.php in concrete/helpers directory and SOLVED the problem!
I've found it by analyzing the raw content of the mail that I've got (following a small piece for understanding):
Now we know that in SMTP protocol two consecutive CRLF determine the begin of the mail body.
The problem is around "Content-type: text/plain; charset=UTF-8", watching in hex i've found that sequence: "0d 0d 0a".
That means that after "MIME-Version: 1.0" the real mail started, resulting in loosing the following headers lines (that you could see in the body...)
So i changed the line 122 and 123 of mail.php removing "\r" leaving only new line "\n", so the resulting of those two lines is the following:
Hm, that maybe can fix the encoding (I'm a real newbie of php), but the double CR? Does it work for you? Don't you receive a mail with a body that begin as the following?
Content-type: text/plain; charset=UTF-8
From:<mail inserted in form>
Mime-Version:1.0
Content-Transfer-Encoding: BASE64
<the form content>
Plus it comes from an anonymous user...
If you fix the header it comes from the mail that the user inserted in form and no wrong header at the beginning of the form.
Can you check how are your mails?
However the body is still encoded in BASE64 and you have too "Mime-Version: 1.0" twice (I didn't mention that but me too).
I'll test your solution to see the effects returning to standard mail.php.
However the problem, I believe, was not the mispelling, but the "\r\n" that becomed "\n".
Can you check if you have "0D 0D 0A" or "0D 0A" before and after "Contet-type: text/plain; charset=UTF-8"?
I got that 'gibberish' also. Taking off they '\r' worked. I tried the .htaccess method, but that did'nt make any differance for me. I use Thunderbird for my pop mail.