Solved

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

Posted on 2010-09-02
2
462 Views
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";



  $sendEmail->attach(

    Type        => "text/html",

    Data        =>  $INLINE_HTML

    );



    # Header Graphic referenced in $INLINE_HTML

    $sendEmail->attach(

      Type        => "image/jpeg",

      Id          => "emailHdr.jpg",

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

      Filename    => "emailHdr.jpg"

      );



      $sendEmail->attach(

        Type        => "text/html",

        Id          => "TEST.html",

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

        Filename    => "TEST.html",

        Disposition => "attachment"

        )

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



  $sendEmail->send('sendmail',SetSender=>1);

Open in new window

0
Comment
Question by:Bob-Villa
2 Comments
 
LVL 13

Accepted Solution

by:
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?
0
 
LVL 1

Author Comment

by:Bob-Villa
ID: 33599513
lol. multipart/mixed fixed the issue. Thanks for the tip.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Example unit tests with AngularJS 3 40
What is assert.deepEqual? 4 39
File attachment not working in email on iPhone 7 9 46
Apple watch forgot password 2 41
Let me explain this picture a little bit.  First, in case you haven't already guessed, you are looking at my 2 phones, an Android Samsung Galaxy S5 on the left and an iPhone 5 on the right.  They are on their respective cradles on my desk.  But, you…
Let Bitmoji into your life. Now is the time to learn a new language of smartphone messaging with this brief introduction.
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

867 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

15 Experts available now in Live!

Get 1:1 Help Now