Subject: | Re: Mail::Sender::Easy (inline image plus attached PDF like in example) |
Date: | Tue, 02 Dec 2014 14:50:50 -0700 |
To: | Daniel Muey <dmuey [...] cpan.org>, Scott Welling <scottw [...] nffs.com>, bug-Mail-Sender-Easy [...] rt.cpan.org |
From: | James Alton <jamesa [...] nationalfitness.com> |
I would like to submit this diff to Mail::Sender::Easy v0.0.5. It will
allow inline images / attached PDFs (as the example for
Mail::Sender::Easy shows) to work correctly with the latest version of
Thunderbird. (Email client)
The difference is that after applying this diff, the HTML part will have
a mime type of multipart/related with another sub-branch and include the
images there. (This is how Thunderbird does it when you send with an
inline image and attached files.)
I've also tested this using Gmail and iPhone "Mail" (iOS 7). (Both
worked perfectly.)
It will also allow using the '_no_custom_headers' option to avoid
putting my program's path in the headers.
40d39
< my $no_custom_headers = delete $mail_ref->{'_no_custom_headers'};
68,70c67
< unless ($no_custom_headers) {
< local $Mail::Sender::SITE_HEADERS = join("\015\012",
@siteheaders) || '';
< }
---
Show quoted text
> local $Mail::Sender::SITE_HEADERS = join("\015\012",
@siteheaders) || '';
88,91d84
< 'ctype' => 'multipart/related'
< });
<
< $sndr->Part({
98a92
Show quoted text> $sndr->EndPart('multipart/alternative');
119,133c113
< my @attach_array = keys %{ $attachments };
<
< #sort attachments that define _inline attachments to be first
< @attach_array = sort { ($attachments->{$b}{'_inline'} ||
'') cmp ($attachments->{$a}{'_inline'} || '') } @attach_array;
<
< my $processed_all_images;
<
< for my $attach (@attach_array) {
<
< #Encountered first attachment that isn't an image
< if((not defined $attachments->{ $attach }{'_inline'})
&& $html && !$processed_all_images) {
< $sndr->EndPart('multipart/related');
< $sndr->EndPart('multipart/alternative');
< $processed_all_images = 1;
< }
---
Show quoted text> for my $attach (keys %{ $attachments }) {
Thanks,
James Alton