When calling

mimemail('xx@xx.de', $mail, $message['subject'], $message['body'], TRUE, array(), $message['body'], array(array('filepath' => '...', 'filemime' => 'application/pdf')), 'accept')

the sent email contains an trailing newline \n character.

As workaround I changed in my installation the line in mimemail_prepare()

$subject = mime_header_encode(drupal_html_to_text($subject));

to

$subject = mime_header_encode(trim(drupal_html_to_text($subject)));

It seems that drupal_html_to_text() adds the trailing newline.

Comments

bjcool’s picture

Status: Active » Closed (duplicate)

Duplicate

new_B’s picture

Status: Active » Closed (duplicate)

The code with trim() above already appears to be in the alpha1 version; however, I am experiencing the subject newline issue. For long subject lines, a box appears at the cut-off point in Outlook 2007. Has anybody encountered this issue and/or have suggestions on solving it?

Thanks in advance.

new_B’s picture

Version: 6.x-1.x-dev » 6.x-1.0-alpha1
Status: Closed (duplicate) » Active

Sorry, couldn't seem to find the duplicate of this issue so setting it to active.

new_B’s picture

After looking into it further, I realized that trim() only strips out the newline if it is at the end of the subject. In my case, what appears to be a newline appears in the middle.

new_B’s picture

I found a related post, which seems to solve the issue at http://drupal.org/node/438058#comment-2612180.

sgabe’s picture