Community Forum

Over the years we have built up a community of email marketers, coders and designers that live and breathe email.

Use the Email on Acid Forum like your virtual water cooler: Stop by to discuss email code, quirky clients and fixes and post your issues (with an example of the code) for our community to offer its assistance.

 
   
html failing on iPhone iOS4 with large attachments?

mmlab

Newbie
Total Posts:  2
Posted: 02 March 2011 11:22 PM

I’m going around the bend trying to resolve a recurrent problem. On some emails with pdf attachments, html is being rendered as messy text on iPhone (it sometimes defaults to the text alternative).

Without an attachment, rendering is fine. I’ve also had it working fine with smaller attachment(s) (0.2MB-0.5MB).

The problem repeats whether sent from an email marketing host, or Microsoft Exchange.

The problem repeats on iPhone 3G and iPhone 4 (both running iOS4). It doesn’t seem specific to the html, as this has been checked carefully (including using EmailOnAcid), and the problem recurs even with a very simple test email. Repeats on iPhone with both MS Exchange and Gmail (both utilising AcitveSync on the iPhones). Different problems on more normal Gmail iPhone email setup, but that’s probably to be expected.

My suspicion is the problem relates to larger attachment sizes (c. 4MB in this instance). I also guess it may have appeared with recent versions of iOS (things seemed okay up until 2-3 months ago). My tests found that with one or two 2 x 0.2MB attachments, things were fine, but having combination of 0.2MB and a 1MB attachment failed, 3 x 0.2MB also failed. Larger 4MB attachments typically fail—but this has erratically worked in the recent past—and used to be fine (months ago).

I haven’t been able to find any close reference to a similar problem, so I was wondering if anyone here has encountered something like this, probably specific to iPhone, possibly iOS4, and likely related to the size of attachments.

Thx


 

Michelle Klann

Avatar
Administrator
Total Posts:  204
Posted: 03 March 2011 05:28 PM
[ # 1 ]

mmlab,

Thanks for posting this to our forum.  We have not spent any time testing with attachments since they are a little less common for bulk emailing purposes but some of our readers might benefit from your research. 

In the meantime, have you considered just including a link within your email to a PDF download instead of trying to attach it?

Cheers,
Miki


 

mmlab

Newbie
Total Posts:  2
Posted: 04 March 2011 11:10 AM
[ # 2 ]
Michelle Klann - 03 March 2011 05:28 PM

mmlab,
In the meantime, have you considered just including a link within your email to a PDF download instead of trying to attach it?

Thanks Miki—unfortunately, we need to include attachments as this is paid/premium content, and links reduce access and simplicity. b2b recipients who might often, for example, process their email on a plane or other occasions when internet access poor or non-existent. For marketing, links of course best practice.

Further experiments all point to newer versions of the iPhone iOS failing to render html when attachment payload tops 0.5MB. Feels like a bug as erratic. I’ll keep testing and pursuing, but if anyone can shed further light, it would be great to hear.

Also/alternatively, is there a way to force iPhone’s to display the alternate polished text version, rather than chewing up the html as messy text?

Thx


 

Michelle Klann

Avatar
Administrator
Total Posts:  204
Posted: 04 March 2011 03:20 PM
[ # 3 ]

To answer your question:

Also/alternatively, is there a way to force iPhone’s to display the alternate polished text version, rather than chewing up the html as messy text?

Yes, you could try using embedded or linked media queries. Media queries work correctly in the iPhone and the iPad’s native email client, however they do not work for iPhone and iPad Gmail.  I am not sure if you have tested this in the Gmail mobile app.

The only drawback is that you would also be forcing the Android readers to the text version. 

Here’s an example of the code you would need to use in order to get it to work:

@media screen {
  
{ font-familysans-serif }
  
.mobile_content {displayblock}
  
.nonmobile_content {displaynone}

This way you could hide/show content as you desire.  Just remember, Gmail does not support embedded or linked CSS so your layout would have to look good with and without the media query.

Hope this helps!


 

Michelle Klann

Avatar
Administrator
Total Posts:  204
Posted: 04 March 2011 03:36 PM
[ # 4 ]

Actually, here’s a better, more complete example:

<html>
<
head>
<
title>Document Title</title>

<
style type="text/css">
    @
media screen {
      
{ font-familysans-serif }
      
.mobile_content {displayblock} !important
      
.nonmobile_content {displaynone}  !important
    }  
     
</style>
</
head>

<
body>

    <
div class="mobile_content" style="display:none">
       
Mobile Content Here
    
</div>

    <
div class="nonmobile_content" style="display:block">
       
Non-Mobile Content Here
    
</div>

</
body>
</
html

This should look ok in Gmail and all other clients.


 

Simmelink

Newbie
Total Posts:  1
Posted: 17 June 2011 09:22 AM
[ # 5 ]
mmlab - 02 March 2011 11:22 PM

I’m going around the bend trying to resolve a recurrent problem. On some emails with pdf attachments, html is being rendered as messy text on iPhone (it sometimes defaults to the text alternative).

Without an attachment, rendering is fine. I’ve also had it working fine with smaller attachment(s) (0.2MB-0.5MB).

The problem repeats whether sent from an email marketing host, or Microsoft Exchange.

The problem repeats on iPhone ipad 2 keyboard case3G and iPhone 4 (both running iOS4). It doesn’t seem specific to the html, as this has been checked carefully (including using EmailOnAcid), and the problem recurs even with a very simple test email. Repeats on iPhone with both MS Exchange and Gmail (both utilising AcitveSync on the iPhones). Different problems on more normal Gmail iPhone email setup, but that’s probably to be expected.

My suspicionipad 2 wireless keyboard is the problem relates to larger attachment sizes (c. 4MB in this instance). I also guess it may have appeared with recent versions of iOS (things seemed okay up until 2-3 months ago). My tests found that with one or two 2 x 0.2MB attachments, things were fine, but having combination of 0.2MB and a 1MB attachment failed, 3 x 0.2MB also failed. Larger 4MB attachments typically fail—but this has erratically worked in the recent past—and used
ipad 2 standto be fine (months ago).

I haven’t been able to find any close reference to a similar problem, so I was wondering if anyone here has encountered something like this, probably specific to iPhone, possibly iOS4, and likely related to the size of attachments.

Thx

Media queries work correctly in the iPhone and the iPad’s native email client, however they do not work for iPhone and iPad Gmail.  I am not sure if you have tested this in the Gmail mobile app.