send to friend feature is not working on shared hosting. They have PHP5 as cgi. Following is the error:

 * warning: mail() [function.mail]: Bad parameters to mail() function, mail not sent. in /home/content/h/o/s/****/html/u/includes/mail.inc on line 193.
 * Unable to send e-mail. Please contact the site admin, if the problem persists.

Comments

jcnventura’s picture

Status: Active » Postponed (maintainer needs more info)

Maybe you're not allowed to send e-mail?

Asif99’s picture

Site contact form and user registration emails are working fine!

jcnventura’s picture

There are very few differences between the code for the site contact form and the mail code in this module...

I need to know more how I can reproduce this.. Does it happen always, or only when sending to several addresses?

João

Asif99’s picture

Its happening always. With single or more address!
here is phpinfo() link:
http://u.urduseek.com/content/php-info

Asif99’s picture

I just found that the problem is caused by email's subject string:
admin has sent you a message from Urduseek.com انگریزی اردو لغت

If I remove Urdu or shortens the subject by removing few English letters then it goes smoothly.

I am not sure if the problem lies with drupal mail handler or send to friend module!

Thanks,

Asif Hisam

jcnventura’s picture

I have successfully sent an email with the subject that you provided.

I have also managed to send an e-mail with subject: "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwx"

João

jcnventura’s picture

Hi,

Are you able to send an email with the subject in #5 from the site contact form?

João

Asif99’s picture

Just tried the contact form with this subject and it also failed!
So problem is with core module.
Interestingly its working on my local machine which is windows/apache2.1/php5.26.

Thanks,

Asif Hisam

jcnventura’s picture

Project: Printer, email and PDF versions » Drupal core
Version: 6.x-1.0-rc5 » 6.3
Component: Code » base system
Category: support » bug
Priority: Critical » Normal
Status: Postponed (maintainer needs more info) » Closed (duplicate)

I am closing the issue, as it is now been found to be a problem in Drupal.

The problem is actually known, so this is actually a duplicate of #84883: Unicode::mimeHeaderEncode() doesn't correctly follow RFC 2047.

João

Asif99’s picture

Yes the problem is in the drupal unicode.inc. I found the following patch which fixed this problem:

 --- /Users/Joakim/Workspace/wannabe2/includes/unicode.inc
+++ unicode patched.inc
@@ -249,7 +249,7 @@
     $output = '';
     while ($len > 0) {
       $chunk = truncate_utf8($string, $chunk_size);
-      $output .= ' =?UTF-8?B?'. base64_encode($chunk) ."?=\n";
+      $output .= ' =?UTF-8?B?'. base64_encode($chunk) ."?=\r";
       $c = strlen($chunk);
       $string = substr($string, $c);
       $len -= $c;