iPhone - Can't Open HTML attachments sent with PERL + MIME::Lite

Posted on 2010-09-02
Last Modified: 2013-12-25
I have a program written in PERL that generates HTML email and includes a HTML file as an attachment. Works fine, always has. Can view the attachments in email clients and online however I can't crack the iPhone problem. I see the email, I see the inline html and logo in the message body, I can even see the paperclip indicating an attachment..... but.... I can't see, view or open the attachment.

Howerver... if I take the same file and attach it in Outlook, then send to the iPhone the attachment can be opened
my $sendEmail = MIME::Lite->new(

    From          => $sVars[1],

    FromSender    => $sVars[1],

    To            => $sVars[0],

    Cc            => $sVars[2],

    Bcc           => $sVars[3],

    Subject       => $sVars[4],

    Type          => "multipart/related",

    Datestamp     => $sendDate


    or die "Error Creating Message: $!\n";


    Type        => "text/html",

    Data        =>  $INLINE_HTML


    # Header Graphic referenced in $INLINE_HTML


      Type        => "image/jpeg",

      Id          => "emailHdr.jpg",

      Path        => $ImgPath."/emailHdr.jpg",

      Filename    => "emailHdr.jpg"



        Type        => "text/html",

        Id          => "TEST.html",

        Path        => $PATH."/TEST.html",

        Filename    => "TEST.html",

        Disposition => "attachment"


        or die "Error Attaching File: $!\n";


Open in new window

Question by:Bob-Villa
LVL 13

Accepted Solution

Carl Bohman earned 500 total points
ID: 33597645
Have you tried sending the e-mails somewhere that you can get at the raw message and then comparing both e-mails to see what's different?  Have you tried comparing the full headers to see if there are any important differences there?  Perhaps iPhone doesn't like the "multipart/related" type?  Have you tried another type?

Author Comment

ID: 33599513
lol. multipart/mixed fixed the issue. Thanks for the tip.

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
Are you having trouble connecting or getting your iPhone / Samsung device(s) to sync with Microsoft Exchange Server?   What have you tried?   What haven't you tried?
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now