Simplenews is installed and sends emails OK. I am using Mime Mail 6.x-1.x-dev (for 6.x).
These links are not fully formed in an email received in Thunderbird and Gmail:

Footer - unsubscribe appears as href="/?q=newsletter/confirm/remove/">Unsubscribe from this
newsletter i.e. the tags are missing and the link cannot be followed.

Attachment - same issue, appears without the tags.

I have scoured the documentation and issues but can't fins any mention of this.
Any ideas? Many thanks.

Comments

sutharsan’s picture

Does this only happen in html emails? Does this happen when other modules send html emails? Does this happen in plain text newsletters?
Please investigate further. It is possible that this is a mime mail issue. Please use latest dev versions of both simplenews and mime mail.

cbeem’s picture

Thanks for such a fast response! Much appreciated.

Yes, this only happens with html mail which I realised after my initial post. If 'plain' is selected with or without an attachment the links are displaying correctly except:
Attachments with spaces in the file name do not include the full link, i.e. //mysite/myfolder/test mailout.php appears as a link to //mysite/myfolder/test and the mailout.php is not included. This link is correct before sending in the Drupal screen.

I have not tried any other modules to send html email.

I am happy at this stage to send brief plain text messages with a PDF attached. It is easy enough to remove spaces from a PDF file name!

I will try the latest dev version of simplenews and mime mail and see what happens. Since I already have the latest version of mime mail, I will not change this.

Many thanks.
-------

Update-

I tried the latest development versions of simplenews and mime mail. It works!
I can send html email and the links display correctly. However there are two things I have noticed:

  • If I choose 'plain' the email is sent as a text dump with no line breaks or formatting of links (this worked OK in the first version of simplenews I tried)
  • Images in the html email do not display in the message, but they appear as an attachment. I get the dreaded box with an X in it where an image should be. The path to the broken image in my mail client is 'about:blank'. The image does appear below the email and the path is 'mailbox:///C|/Documents%20and%20Settings/win2000/Application%20Data/Thunderbird/Profiles/gviwan71.default/Mail/Local%20Folders/Inbox?number=215691202&part=1.2&type=image/jpeg&filename=acmn_logo_full.jpg' which is obviously on my local machine.

    Thanks,

    Cliff

  • patrickharris’s picture

    I'm getting the same problem sending html emails with the latest dev versions of simplenews & mimemail. The footer appears as href="/newsletter/confirm/remove/">Unsubscribe from this newsletter and images are displayed as attachments. Any idea what might be causing this?

    patrickharris’s picture

    I wonder why more people aren't experiencing this? What seems to be happening, is that drupal_mail (in mail.inc) performs drupal_wrap_mail on the message body. Mimemail then performs a check_markup in its drupal_mail_wrapper() function ... and line break converter filter has fun in inserting numerous breaks all over the place which destroy the html message.

    Can anyone else duplicate this?

    sutharsan’s picture

    I've seen this problem before but can't find it in the issue queue. Pls try the latest dev version of both modules and perhaps you have more luck searching the queue.

    patrickharris’s picture

    I'm using the latest dev versions of simplenews and mimemail.

    cbeem’s picture

    Just wondering, has this got anything to do with cleanurls? I am NOT using cleanurls, mostly because things just seem to go better without them - I have had all sorts of problems with various modules and css when using cleanurls. I too am using the latest dev versions of simplenews and mime mail. Links are appearing correctly now but images are all attachments.

    cbeem’s picture

    I have gone with phplist and the phplist integration module.
    The phplist setup is working perfectly with Drupal.

    I hope you can get simplenews running reliably, I like the interface.
    Thanks for your time and effort.

    hnln’s picture

    I fixed the unsubscription link by theming theme_simplenews_newsletter_footer. I copied over the function from the module and in the format == 'html' condition I modified the line like so:

    global $base_url;
    $output = '<p class="newsletter-footer">'. l(t('Unsubscribe from this newsletter', array(), $language->language), $base_url.'/newsletter/confirm/remove/'. $hash, array('html' => TRUE, 'language' => $language)) .'</p>';
    

    Where the change is adding in the $base_url in the link function.

    Hans

    sutharsan’s picture

    Category: support » bug
    Status: Active » Fixed
    StatusFileSize
    new1.14 KB

    HnLn, thanks for diving in. Although your solution is not optimal, you are definitely on the right track! The attached patch solves this by adding an 'absolute' = TRUE to the l() function.

    The attached patch has been committed to 6.x-1.x-dev.

    sutharsan’s picture

    Status: Fixed » Active

    b.t.w. this only solves the footer link problem.

    OneTwoTait’s picture

    I had the exact same problem. Installing the dev version fixed it.

    I still just get plain text like "Unsubscribe from this newsletter" on Hotmail though.... hmmmm

    cbeem’s picture

    Something I have just noticed, I am using Mime Mail 6.x-1.x-dev - the core email module seems to be broken when this is installed. I get empty body and footer for emails sent out with anything that comes from the Drupal authentication (login) module, i.e. any emails to new users etc. are blank. Deleting Mime Mail fixes it. Obviously this is a Mime Mail bug but I thought you should know, since simplenews requires it.

    sutharsan’s picture

    Status: Active » Fixed
    StatusFileSize
    new2.44 KB

    @patrickharris: I found the issue I thought handles the double filtering. #305650: Restore Mime Mail support in D6 But that was fixed. Related discussion at #306670: Simplenews ignores paragraphes on some installations

    I've made a few improvements on the plain text alternative that simplenews passes on to mimemail. The attached patch is committed to 6.x-1.x-dev. I guess this is all I can do at simplenews side now.

    Re #4: this is now reported frequently in this issue list.

    sutharsan’s picture

    StatusFileSize
    new1.23 KB

    Further testing reveiled that the $text parameter of mimemail() is not only the plain text alternative for HTML emails, but also is the body of the plain text emails. The attached patch corrects this in simplenews.
    Patch is committed.

    Status: Fixed » Closed (fixed)

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

    donquixote’s picture

    Status: Closed (fixed) » Active

    I still don't see how the issue with attachments is supposed to be fixed.

    I tried including attachments as

    <img src="somepic.jpg" >
    <img src="somepic.jpg" />
    <img src="internal:sites/default/files/somepic.jpg" >
    <img src="internal:sites/default/files/somepic.jpg" />
    

    but none of these results in

    <img src="somepic.jpg">
    

    The first two create broken images like

    <img src="Array" >
    

    I don't see how the above patches (all from 2008) are supposed to fix this issue, so I set it back to active.

    donquixote’s picture

    See also the Mime Mail issue src="Array" if path to image is broken

    sutharsan’s picture

    Status: Active » Closed (duplicate)

    Duplicate. Patched available at #319229: src="Array" if path to image is broken