every time i try and subscribe using the form in the Block i get an error, basically it can't send the confirmation email...

if i am logged in and then press the "subscribe" button all works fine... I am guessing this is because it doesn't try and send a confirmation email?

i have tried the newest version of module, the dev version that came out a few days ago, the approved version... they all have the same problem...

i haven't found anyone with the same problem though...

any advice?

in red box:

warning: mail() [function.mail]: Bad parameters to mail() function, mail not sent. in /home/content/n/e/d/nedich/html/obama/includes/mail.inc on line 193.

Unable to send e-mail. Please contact the site admin, if the problem persists.

in green boc:
You will receive a confirmation email shortly containing further instructions on how to complete your subscription.

note: even though last message says i will receive email etc i never get one...

CommentFileSizeAuthor
Picture 71.png18.05 KBmarlowx

Comments

sutharsan’s picture

turn on the mail logging in the sn settings. Report the email content you find in the log.

marlowx’s picture

i got several errors in the log... as i have no idea what they are i'll just list them all here in the order they appeared:

Type php
Date Monday, November 10, 2008 - 01:18
User Comrade
Location http://americasfavoriteterrorist.com/
Referrer http://americasfavoriteterrorist.com/?q=admin/build/block
Message mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in /home/censored/includes/database.mysqli.inc on line 323.
Severity error

=========================

note: this isn't an error but it was the next entry in log:
simplenews
Date Monday, November 10, 2008 - 01:18
User Comrade
Location http://americasfavoriteterrorist.com/
Referrer http://americasfavoriteterrorist.com/
Message Outgoing email. Message type: subscribe
Subject: Confirmation for News from America's Favorite Terrorist!™
Recipient: my@email.com
Severity debug

==========================

php
Date Monday, November 10, 2008 - 01:18
User Comrade
Location http://americasfavoriteterrorist.com/
Referrer http://americasfavoriteterrorist.com/
Message mail() [function.mail]: Bad parameters to mail() function, mail not sent. in /home/blahblahblah/html/obama/includes/mail.inc on line 193.
Severity error

==========================

Type mail
Date Monday, November 10, 2008 - 01:18
User Comrade
Location http://americasfavoriteterrorist.com/
Referrer http://americasfavoriteterrorist.com/
Message Error sending e-mail (from deleted email address so no spam.com to me@email.com).
Severity error

=============================

Type php
Date Monday, November 10, 2008 - 01:18
User Comrade
Location http://americasfavoriteterrorist.com/?q=node
Referrer http://americasfavoriteterrorist.com/
Message mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in /home/content/blahblahblah/html/obama/includes/database.mysqli.inc on line 323.
Severity error

==============================

Type php
Date Monday, November 10, 2008 - 01:18
User Comrade
Location http://americasfavoriteterrorist.com/
Referrer http://americasfavoriteterrorist.com/?q=node
Message mysqli_real_escape_string() expects parameter 1 to be mysqli, null given in /home/blahblahblah/html/obama/includes/database.mysqli.inc on line 323.
Severity error

sutharsan’s picture

Status: Active » Postponed (maintainer needs more info)

You first need to solve the oldest of the above errors, this is fundamental. The simplenews error may well be a result of this.

sutharsan’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No response, closing the issue.

pawel.traczynski’s picture

Version: 6.x-1.0-beta5 » 6.x-1.0-rc4
Status: Closed (fixed) » Fixed

Found out solution:

You need to modify 'mail.inc' file contained in '/includes' directory of the Drupal installation.

Change the line 186 from:
mime_header_encode($message['subject']),
To:
str_replace("\n", '',mime_header_encode($message['subject'])),

I know it's hard coding in the core files but it works.
Now you can include parameters in the email title - like '!site' - and message will be send :-)
CYa!

kenorb’s picture

Status: Fixed » Needs review

Patches hacking the core related to functionality of some contributed module are not good solutions, especially marking them as fixed:)
http://drupal.org/patch/review

kenorb’s picture

The error means that mail() function received the wrong arguments from simplenews.
You have to check what parameters has been send to mail() function (php.net/mail).
Look for the line:

    drupal_mail('simplenews', 'subscribe', $mail, $subscription->language, $params, $params['from']['address']);

And paste it before that line:

    watchdog('simplenews', "drupal_mail('simplenews', 'subscribe', $mail, $subscription->language, $params, {$params['from']['address']})");

And check your logs, what has been passed to your drupal_mail.
And compare with requirements: http://api.drupal.org/api/function/drupal_mail
I didn't test that code, so look after some syntax mistakes, just for general idea to know what you looking for.

avpaderno’s picture

There is already an issue report opened for Drupal. It seems the problem is mail().
See #84883: Unicode::mimeHeaderEncode() doesn't correctly follow RFC 2047 for more informations.

avpaderno’s picture

Title: warning: mail() [function.mail]: Bad parameters to mail() function, mail not sent » Bad parameters to mail()
Category: bug » support

I am changing the category as this is not a bug of the module which simply uses a Drupal function.
The problem, if that can be fixed, must be fixed in Drupal core code.

avpaderno’s picture

Status: Needs review » Active
kenorb’s picture