Closed (duplicate)
Project:
Mime Mail
Version:
6.x-1.0-alpha1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Nov 2009 at 16:18 UTC
Updated:
7 Apr 2010 at 09:09 UTC
Jump to comment: Most recent file
Comments
Comment #1
Mark B commentedI've tracked this down to the _mimemail_file function in mimemail.inc
This function maintains two static arrays of referenced files which have been generated for the email being built:
$filenames = the names of the files which have been referenced and built
$files = the content of the files
When the email has been completely built, the function is called again, and the $files array is returned and cleared. However, the $filenames array is not cleared. This means that if a second email is built, the static $filenames array thinks that common files have already had their content built. However, their corresponding entry in $files has been cleared.
The solution is to clear the $filenames array at the same time as the $files array is cleared once the email has been completely built.
Comment #2
Mark B commentedPatch file attached. Patch created against 6.x-1.0-alpha1, but bug exists in latest dev version too (which confusingly seems to be dated earlier than the 6.x-1.0-alpha1 release)
Comment #3
Mark B commentedComment #4
czollli commentedThanks, it works fine!
Comment #5
czollli commentedHi Mark,
I don't really understand the reason of array reinitialization
at the and, because these arrays marked static.
Before I have found your patch I removed the $files=array() line
and it also worked.
Or is it a special reason to do that?
Czollli
Comment #6
kurkuma commentedIt works fine :-)
Comment #7
roball commentedCan someone please advise how to get an image (header logo) sent with the HTML mail? I'm using Simplenews together with Mime Mail, using the "html" Newsletter format. The HTML is generated using Wysiwyg API together with tinymce.
Thanks.
Comment #8
cafuego commented@roball Use the simplenews_template module
Comment #9
cafuego commentedSpeaking of simplenews_template, the patch attached above fixes the problem for images embedded in the node content, but seems to not fix the issue for images as defined in the simplenews_template header and footer.
In fact the header and footer images don't even get replaced with an inline
tag anymore, but just disappear after I apply this patch.
Comment #10
roball commentedThanks cafuego! However, I can't get that module to work with the 2.x version of Simplenews - see #660662: Working with Simplenews 6.x-2.x-dev
Comment #11
cafuego commentedI'm not using simplenews 2.x-dev, but stable version 6.x-1.0.
Comment #12
roball commentedcafuego, sorry for the confusion - the additional fieldsets provided by Simplenews Template are now visible with Simplenews 6.x-2.x-dev.
Comment #13
Peter Bex commentedPlease make a bugfix release (1.1), as this is a major problem with this module which should really not be allowed to exist for so long in a stable version.
Comment #14
acb commentedThis is not fixing my problem; first mail gets sent with attachment intact; second gets sent with no attachment but the cid number below the mail.
Comment #15
cafuego commentedWhen I apply the patch, the attachments (and images) now work properly with simplenews 1.0
Comment #16
acb commentedCafuego, some questions:
1) are your images in the body of the node?
(I have not tested w. attached images)
2) Are they absolute or relative URLs?
Absolute URls in the node work (as images are not embedded in emails) The relative URLs do not get embedded in newsletters after the first one.
Comment #17
cafuego commentedHmm. why isn't my reply here.
@abc:
1) My images are in the body of the node and in the bodies of additional nodes I add via the related_content module.
2) The URLs are absolute from the site root. They do not include the entire !site_url as well.
Comment #18
acb commentedRight; if you use relative URLs you get the error, I think
Comment #19
bkonetzny commentedResetting $filenames at the same time $files is reset in _mimemail_file() fixed the problem with missing files on batch e-mail operations. Thanks!
Comment #20
acb commentedcould you post your code? Are you using relative or absolute URLs?
Are your files attached or are they in the body of the message?
Comment #21
sgabe commentedMarking as duplicate of #358439: Images are only in the first message.