themonk has asked for the wisdom of the Perl Monks concerning the following question:

Hi guys, i want a help about mail::sender. the mail i m sending has inline attachment(image) as well as normal attachment(e.g., pdf,doc)....i think for this the multipart should be "mixed". When such mail is send it works fine in email clients like outlook, gmail..but shows a different behaviour in Ipad. In Ipad the inline images appear rightly in the html page of email, but also shows all the inline attachment(images) at the bottom of the email just like the normal email. on the contrary i send out a test email with a signature(coz it has inline attachment), along with the normal attachment. it looks fine in all the email client along with IPAD. thanks in advance. Rohit.
P.S: also tried mime:lite and mail::sender::easy but didnt work for me.

Replies are listed 'Best First'.
Re: mail::sender - email header - IPAD
by bobdabuilda (Beadle) on Apr 18, 2012 at 05:33 UTC

    Whilst I'm not able to help you directly with the problem at hand, I *can* possibly help you make it more likely folks will bother reading your posts...

    I strongly recommend reading up on a couple of FAQs to help you know how best to both phrase and format your requests and answers:

    Writeup Formatting Tips How do I post a question effectively?

    The easier you make it for folks to read your questions and responses, the more likely they are to actually read it... which makes it more likely they'll also take the time to respond :)

    In the mean-time, I hope you get this sorted. But considering the issue is being experienced by other mailer apps/techs, I think you need to consider that the fault could be at the receiving end, rather than the sending end...

      Probably i didn't frame the question right but isn't much of the receiving end problem(as far as i see). I'll explain why.
      If i send the mail to ipad from say gmail/outlook with a inline attachment then the email appears right. But when the same mail is send via mail::sender then the above behavoiur is shown.

      i had posted the stackoverflow link so that the relevance of the issue can be overlapped and i think from there i did got a clue...

      i think i found a clue as why it isnt working.....

      "mixed dispositions handles within the same boundary range"
      Coz when i send out an email from gmail i see that the mail header has a hierarchy in the boundary part.....something like this.....
      3 boundary's

      1. pdf attachment boundary_id....e4a,mixed
      2. inline_attachment boundary_id....e49, related
      3. body (plain text) ....e48, alternative
      And when i send out mail from Mail::sender...i get all the mail as...
      --boundary-test-1
      in all the multiparts....i guess it should use 3 boundarys if the message to be send out is "MIXED".....


      Is the relevance incorrect?

        If you know what mix of boundaries you need to convince IPAD to display the email the way you want, see the Part() method and the examples near the end of the docs.

        Jenda
        Enoch was right!
        Enjoy the last years of Rome.

        Guys any pointers......
Re: mail::sender - email header - IPAD
by Anonymous Monk on Apr 18, 2012 at 04:26 UTC

    There is no problem

      Sorry...i didnt get u.
      There is a problem but coz i tried all the premutations within multipart and there still seems to be problem. The problem is i cant show u how the issue output looks..one has to try out that on the ipad/iphone itself to see the issue. if any case i am doing anything wrong....do mention coz i really want to get this issue resolved.

      Sample code: use Mail::Sender;
      $sender = new Mail::Sender;

      if (ref $sender->OpenMultipart({
      from => 'someone@somewhere.net', to => 'abc@xyz.com',
      subject => 'Embedded Image Test',
      ctype => "text/html",
      boundary => 'boundary-test-1',
      encoding => 'base64',
      multipart => 'mixed'})) {
      $sender->Body({msg => 'Hello World <img src="cid:smile1"
      />'}); $sender->Attach(
      {description => 'pdf',
      # ctype => 'appledouble',
      encoding => 'base64',
      disposition => "attachment;
      filename=\"AWD.pdf\";", file => '../AWD.pdf'
      });
      $sender->Attach({
      # description => 'ed\'s JPG',
      # ctype => 'appledouble',
      encoding => 'base64',
      disposition => "inline; filename=\"28055.JPG
      \";\r\nContent-ID: <smile1>",
      file => '../28055.JPG'
      }); $sender->Close() or die "Close failed! $Mail::Sender::Error\n";
      } else {
      die "Cannot send mail: $Mail::Sender::Error\n";
      }

      This same problem had arised to php either.....heres the link...

      http://stackoverflow.com/questions/9564045/phpmailer-email-with-inline-images-and-pdf-attachments
      thnks in advance.

        What some email client (ipad ... ) chooses to display or not display, how it behaves, there is very little you can do to influence that -- there is no problem to be solved from your end

        The stackoverflow thread you linked is different problem from the one you described, but it contains code, even if it is php

        Your post contains no code , and your problem statement is that there is nothing wrong with the email, except some ipad email client doesn't hide attachments -- it doesn't have to hide them

        There is no problem, the email isn't malformed, the client isn't broken, there is no problem, nothing to be fixed, nothing you can do