System.Mail in the system service does not appear to work properly on Drupal 6.2 or 6.3. Looking at the code, it doesn't have the right number of parameters for the drupal_mail function in Drupal 6.

Return values when using on Drupal 6.2

Array
(
    [id] => tester_ethan.kaplan@wbr.com
    [to] => This is a test
    [from] => Array
        (
        )

    [language] => This is a test
    [params] => 
    [subject] => 
    [body] => 
    [headers] => Array
        (
            [MIME-Version] => 1.0
            [Content-Type] => text/plain; charset=UTF-8; format=flowed; delsp=yes
            [Content-Transfer-Encoding] => 8Bit
            [X-Mailer] => Drupal
            [Errors-To] => ethan@blackrimglasses.com
            [Return-Path] => ethan@blackrimglasses.com
            [Sender] => ethan@blackrimglasses.com
            [Reply-To] => ethan@blackrimglasses.com
            [From] => ethan@blackrimglasses.com
        )

    [result] => 1
)

even when properly submitted on the test form.

On Drupal 6.3, it errors out completely.

CommentFileSizeAuthor
#2 system_service_mail.patch2 KBsrhaber

Comments

ethank’s picture

can someone obfuscate my e-mails here :)

srhaber’s picture

Title: system.mail does not woork » system.mail does not work
StatusFileSize
new2 KB

The issue seems related to the changes made to drupal_mail() function in Drupal 6. The system_service module is still invoking drupal_mail() as if it's Drupal 5.

View the differences here:
http://api.drupal.org/api/function/drupal_mail/5
http://api.drupal.org/api/function/drupal_mail/6

Attached is a quick patch I made to fix this problem. It renames the original mail function to system_service_mailprepare, and adds a new system_service_mail function which adds the needed parameters to the message array. There is probably a more elegant way to fix this permanently, but this should suffice for now.

brmassa’s picture

Status: Active » Fixed

Ethan and Shaun,

the patch was commited. Its on CVS and soon on the next release

regards,

massa

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.