Closed (fixed)
Project:
Drupal core
Version:
7.8
Component:
mail system
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
5 Apr 2011 at 18:17 UTC
Updated:
26 May 2013 at 07:12 UTC
Hi.
When I create a user, or in general wants the system to send an email, I get this error:
Warning: mail(): Bad parameters to mail() function, mail not sent. i DefaultMailSystem->mail() (linje 77 af /hsphere/local/home/[site]/modules/system/system.mail.inc).
Can't send email. Contact the administrator if this continues.
Well. Safe-mode's off. I run PHP 5.2.17 from a Linux server and I'm testing from Win7 and both IE and FF. Only admins are allowed to create users.
I have no clue at all of what to do. Please help me.
Comments
Comment #1
cbh commentedSame problem here on a Lunux system, current versions of Drupal and Backup and Migrate, which is having the mail problem. Message for me is:
warning: mail(): Bad parameters to mail() function, mail not sent. in /hsphere/local/home/mydomain/sites/all/modules/backup_migrate/includes/destinations.email.inc on line 139.
Comment #2
yanchen commentedSame here. Hosted on Godaddy.com. If you change the mail to all English, the problem is gone.
Comment #3
cbh commentedI'm not sure what you mean by changing the mail to "all english" - where would I do that. The site language is already english. I'm using the Mime Mail module and there's no language preference indicated there.
Comment #4
MLynnerup commentedHi,
I'm having the excaltly same problem in 6.22 on a Linux host. Running all english (install language) no problems, while when I change to Danish I consistently receives the error message - though the mail is sent.
Any clues?
Comment #5
oadaeh commentedTo everyone, what other mail modules do you have installed and enabled on your systems?
The ones I am particularly interested in are Mail System, Mime Mail, PHPMailer and SMTP Authentication Support, but there could be others.
I suspect your problems are being caused by toxic interaction with one or more contrib modules.
@MLynnerup: you cannot possibly be having exactly the same problem, as DefaultMailSystem->mail() is not in Drupal 6. I suggest you re-examine your error message(s), but it is still probably caused by toxic interaction with one or more contrib modules.
Comment #6
ozili commentedComment #7
ozili commentedAfter a lot of time spending on it, I think I found the solution.
If you have the message telling you that you have bad parameters in " /modules/system/system.mail.inc " :
in the file system.mail.inc, just replace
$mail_subject = mime_header_encode($message['subject']);
with
$mail_subject = str_replace("\n", ' ', mime_header_encode($message['subject']));
I hope it will help you
Best regards and sorry for my poor english...
Comment #8
oadaeh commented@ozili: that's the wrong solution. The next time you upgrade Drupal, you'll have to remember to make that fix again.
The real fix is to find out which module is setting that subject and have the maintainer of that module fix their code.
I can help you with the fix, if you can determine the module that is causing the problem.
I'm also re-opening the issue until I hear back from the OP (or don't hear back at all).
Comment #9
ozili commentedok sorry...
Comment #10
bigbigT commentedI am using 7.8, and the same problem. I find out that the problem occurs when using Hsphere , when I am using Cpanel, there is no such problem.
Warning: mail(): Bad parameters to mail() function, mail not sent. in DefaultMailSystem->mail() (line 87 of /hsphere/local/home/mysite/modules/system/system.mail.inc).
Comment #11
bigbigT commentedI have tried ozili's method, it doesn't work for drupal 7.8. On the contrary, it may cause more serious problems.
Comment #12
bigbigT commentedI have solved the problem.
We have this problem because we are using non-English characters in the mail we send to users(I am using Chinese).
To solve it, just go to Configuration-Account settings, to change all the default mail content "[site:name]" to English.
Comment #13
acavayas commentedI have exactly the same problem. I tried to switch to english but the problem persists!
I am hosted on godaddy...
Any other idea on how to fix this?
Comment #14
margunnarsson commentedYes #12 is a bit unclear.
If I remember correctly I went to admin/config/people/accounts/settings and in the Subject of the Email template ( bottom of the page ) make sure there are no special chars.
(I think its OK to have it in the Body, please test)
Comment #15
orozcoraulm commentedYes #12 and #14.
I had the same problem and after making changes in mail.inc in order to review the mail() function passed parameteres, i found special characters in the string from the Site Information/Name value. I edited the name in order to eliminate all special characters and all worked fine.
In summary: do not use special characters in the Site Information/Name.
Comment #16
dddave commentedper #15
Comment #18
juanhc commentedYes #15. Im use Drupal Core 7.22. In my case i need my site in spanish (and i still use this language) and im working with the Forward module. The $mail_subject variable in system.mail.inc don't accept special characters. When the subject for the email collect the [site:name], the [forward:sender] (used in the Forward module) and the "Forward Message Body" field (from the same module) if any of this have an accent or special character not send the email for the RECIPIENT, but sends the email confirmation for the sender. Maybe a function for replace the special characters in the $mail_subject variable?