its not a common problem, but i think it deserves a posting
Problem
Mails - password, feedback, whatever - are not sent by the drupal installation 4.5/4.6, but no error occurs
Reason
Some providers have set up a special requirement to use the sendmail function (mostly used by the php mail(); function)
There needs to be a parameter -f + emailadress to successfully send an email through php
Solution
Look into the modules/user.module for function user_mail and this code
return mail(
$mail,
mime_header_encode($subject),
str_replace("\r", '', $message),
"MIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8; format=flowed\nContent-transfer-encoding: 8Bit\n" . $header
);
you need to add "-f from@example.com" so it looks like
return mail(
$mail,
mime_header_encode($subject),
str_replace("\r", '', $message),
"MIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8; format=flowed\nContent-transfer-encoding: 8Bit\n" . $header,
"-f from@example.com"
);
do not miss the single , behind $header
for the emailaddress you can use whatever valid email you like
There is a small problem with this solution too, ALL emails sent by drupal will get this "from" adress.
If there are enough users with this problem id like to see a feature request for adding additional email parameters.
-micha
work in progress langmi.de