Hello
… it doesn´t work in version 2.3.4 either (my test worked only because I used my own mailaddress).
BUT! I think I have figured out what is wrong. My host (One.com) has blocked the option to send emails with "from" mailaddresses that does not belong to the actual domain.
As I assumed, it depends on the servers configuration.
I did a couple of tests on the domain Signalposten.dk:
This didn´t work:
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
This DID work:
$headers = 'From: info@signalposten.dk' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
Looking in the function my_mail in functions.inc.php it looks like you put the users mailaddress in the "From" field and thats why it fails.
The "From"-header gets build from line #2254 to line #2261 of the file includes/functions.inc.php
in the master branch (2018-07-17).
That's, what the code currently looks like:
if($from == '')
{
$headers = "From: " . encode_mail_name($settings['forum_name'], $mail_charset, $mail_header_separator)." <".$settings['forum_email'].">". $mail_header_separator;
}
else
{
$headers = "From: " . mail_header_filter($from) . $mail_header_separator;
}
If I´m right, you should put the forum mailaddress in the "From" field and the users mailaddress in the "Reply-to" field. My test at Signalposten.dk worked using this approach.
Currently there is no occurence of a "Reply-To"-header. I would like to change the code to:
$headers = "From: " . encode_mail_name($settings['forum_name'], $mail_charset, $mail_header_separator)." <".$settings['forum_email'].">". $mail_header_separator;
if($from == '')
{
$headers .= "Reply-to: " . mail_header_filter($from) . $mail_header_separator;
}
That way the sender ("From") is the forum in every case and a "Reply-to" header gets added, if a divergent senders address is set.
Tschö, Auge