E-mail display on mobile device - iphone

I am having an issue with the way an e-mail display on an iPhone. On the desktop in Apple Mail it looks fine. On an iPhone, the text wraps (see image attached, the top part is how it displays in apple mail on a desktop machine, the bottom is now it displays on an iPhone). Is there a way to make the viewport adjust to display it at full-width.

FYI, code snippet for the e-mail is below using PHPMailer and iCal support. The HTML has inline CSS since that seems to work best for support in most e-mail clients. <Style> tags and stylesheets don't seem to work. As I mentioned, having large text enabled in the accessibility settings for my iPhone was the problem. Displays fine when I turn that off. I guess still an issue for those with that feature turned on, but I think that is an Apple IOS issue, unless there is a way around it somehow.
$mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
$mail->CharSet = 'UTF-8';
$mail->IsSendmail(); // telling the class to use SendMail transport
try {
$myMessage = $header."</body></html>";
$mail->AddAddress($buyerEmailAnet, $buyerFirstName. ' '.$buyerLastName );
$mail->AddCC('xxx');
$mail->AddBCC('xxx');
$mail->SetFrom('xxx', 'xxx');
$mail->AddReplyTo('xxx', 'xxx');
$mail->Subject = 'Los Cabos Airport Shuttles';
$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
$mail->MsgHTML($myMessage); //get HTML from session
$mail->Ical = $invite->render(false);
// $mail->AddAttachment('images/phpmailer.gif'); // attachment
// $mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
$mail->Send();
echo "<!-- Message Sent OK -->";
} catch (phpmailerException $e) {
echo "<!-- ".$e->errorMessage()." -->"; //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo "<!-- ".$e->getMessage()." -->"; //Boring error messages from anything else!
}

Related

PDF Attachments sent from iOS Not Displayed Properly in Outlook Mail Client

When I send an e-mail with a PDF attachment from an iOS device, the PDF attachment doesn't get displayed properly in the Outlook mail client. Here is how it looks like:
(The attachment PDF is actually sent, if you right click the e-mail and select 'View Attachments', then you will be able to view the PDF. However, with the red cross the customers think that the attachment wasn't properly attached.)
Here is the code that sends the e-mail:
MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init];
controller.mailComposeDelegate = self;
[controller setToRecipients:#[#"test#test.com"]];
[controller setSubject:#"Subject"];
[controller setMessageBody:emailData.emailBody isHTML:YES];
[controller addAttachmentData:emailData.reportData mimeType:#"application/pdf" fileName:emailData.reportName];
[self presentViewController:controller animated:YES completion:nil];
There is a workaround: If you set the message body as not HTML ([setMessageBody:isHTML:]), then the attachment is correctly displayed in Outlook. However, this means that you can't properly format the e-mail text and also can't add any kind of HTML signature to the e-mail.
This problem occurs with iOS7; I can't remember too well but I think the attachments were fine in iOS6.
Is it possible to have the e-mail HTML formatted and have the PDF attachment looking good in Outlook? Is the problem at the e-mail creation part or more at the Outlook side? The other e-mail clients (Gmail or Yahoo) seem to be handling this well.
We were working on the same issue and our team spent all day on this one today. One thing that we discovered today is that if the PDF only has one page, it will cause the the error. However, when we added a second blank page to the PDF, then the PDF came through properly as an attachment.
It looks like Outlook is trying to display a single page PDF inline rather than as an attachment. If you add the second page, it worked fine.
Hope that helps.
Did you got reason why PDF attach as in-line instead normal attachment in email?
Know When Mac OS X Mail Will Show a PDF Inline, When as an Icon
To know whether Mac OS X Mail will display a PDF file attachment as an icon or inline, look at the file's length:
PDF files of only one page are displayed inline in the message text.
PDF files with two or more pages are shown as icons.
For the single-page PDF files, you can switch between inline and icon display by selecting View as Icon or View in Place from the context menu respectively. To open the context menu, click on the PDF (shown inline or as an icon) with the right mouse button, click with the left mouse button while holding down Ctrl or tap with two fingers on the trackpad while the mouse cursor is over the PDF.
The following works for me:
// Should octet-stream be more specific for a PDF file?
// YES: It seems that earlier (was this iOS6 or iOS7, before iOS7.1?) that the PDF icon showed up properly with just the #"application/octet-stream" and the fileName having .pdf. However, just now (3/30/14), with iOS7, the PDF icon only showed up when I changed the MIME type to #"application/pdf"
[email addAttachmentData:data
mimeType:#"application/pdf" // #"application/octet-stream"
fileName:justFileName];
Check this http://email.about.com/od/macosxmailtips/qt/et080506.htm
PDF files of only one page are displayed inline in the message text.
PDF files with two or more pages are shown as icons.
I've been working the same problem myself and I've been having all sorts of problems (blog post to my users at https://easybooksapp.com/blog/media-types-for-pdf-attachments).
For most people it's fine, the PDF appears in their mail client fine. But for some mail clients such as Outlook and when viewing Gmail in Chrome I see the same error you're seeing. The attached PDF appears as a broken image, despite the attached file being sent as the correct MIME type (application/pdf). I narrowed this down to a problem in how the Mail app on iOS encodes the attachment when the user has an HTML signature set in their iOS Mail settings. If their signature includes an embedded image (the image data is included in the message) this causes the problem. When users delete their signature and replace it with a plain text or simple html signature it's all fine!
Today I was about to start working on finding out the differences between how OS X and iOS send the mail, as under OS X the mail is received okay. I just repeated the same tests today to discover the problem seems to have gone away in iOS 7.1. To confirm it I've repeated the exact same steps on an older iPad that still has iOS 7.0 and the problem exists as before.
So it looks like it was in fact an iOS problem in the end.
CORRECTION:
I've updated the iPad from iOS 7.0 to 7.1 and the problem still exists. I will have to do some more work to find out what the difference in encoding is between OS X and iOS 7.
Use text/pdf instead of application/pdf.

Is it possible to set a subject to the mail app in Windows 8 metro application, if I am using share contract and sharing files?

First of all, I am sharing the content from my windows 8 metro application to another app (for example Mailto app) so:
Now I am sharing files to mailto app using share contract and sharing files from my application,
I wanted to know if: -
Can I set the subject to the mailto app to which I am sharing files as an attachement to that mailto app, if so please let me know how can I do this?
If not, please let me know what is the work around?
As of now, it's not possible.
Windows 8 recently introduced a new API called protocol activation. With Protocol activation, you can launch other windows 8 apps from your application and pass in data. Microsoft worked on Maps app and you can now pass information to the Map app as shown here (URI Scheme for maps application) http://msdn.microsoft.com/en-us/library/windows/apps/jj635237.aspx
See a code walkthrough at http://blog.jerrynixon.com/2012/10/walkthrough-using-windows-8-custom.html
Now, i am sure very soon, you will see some custom parameters for Mail app that you can pass from your app using protocol activation.
Just my 2 cents
No, it isn't possible to do this at the moment.
I may not be understanding the question correctly but if all you want to do is have the ability to click the "Share" button on the Charms Bar, then select the "Mail" app and have the ability to populate the subject line shown when the "Mail" app's share fly-out is displayed then you can follow this approach:
private DataTransferManager dataTransferManager; //class member
// put the following code block wherever you need it:
// Register as a share source
if (this.dataTransferManager == null)
{
this.dataTransferManager = DataTransferManager.GetForCurrentView();
this.dataTransferManager.DataRequested -= this.OnDataRequested;
try
{
this.dataTransferManager.DataRequested += new TypedEventHandler<DataTransferManager, DataRequestedEventArgs>(this.OnDataRequested);
}
catch
{
};
}
private void OnDataRequested(DataTransferManager sender, DataRequestedEventArgs e)
{
DataRequest request = e.Request;
DataRequestDeferral deferal = request.GetDeferral();
try
{
// this property will set your subject line
// it will also be shown on the Share fly-out (right below the main
// heading that says 'Share'
request.Data.Properties.Title = GetCustomMailSubjectLine();
if (string.IsNullOrEmpty(request.Data.Properties.Title))
{
request.FailWithDisplayText("An operation failed. Please try again.");
}
else
{
// this will also be shown on the Share fly-out, right below the 'Title'
// property set above
request.Data.Properties.Description = GetMyAppsSharingDesciption();
// use request.Data.SetDataProvider() if your data needs to be asynchronously retrieved
// otherwise directly use request.Data.SetData() (or one of the other
//methods depending on what you need)
request.Data.SetDataProvider(StandardDataFormats.Html, RetrieveSharedData);
}
}
finally
{
deferal.Complete();
}
}
private async void RetrieveSharedData(DataProviderRequest request)
{
DataProviderDeferral deferal = request.GetDeferral();
try
{
// this will set your email's body
request.SetData(await GetCustomMailBodyAsync());
}
finally
{
deferal.Complete();
}
}

google chrome app script ask to save as userAppPanel

I encounter a problem using UIApplication in google app script, but only on Chrome 18.0.1025.142 m, my application works fine on Firefox 3.6, and also on chrome 16.x.x.
I updated my chrome version to 19.0.1084.56 m. And the problem still occurs.
On Chrome 18.0.1025.142 m and 19.0.1084.56 m, I have the following behaviour:
A blank frame is displayed over my spreadsheet when I try to display the UI Application and I'm asked to perform a "Save As" operation for an object userAppPanel.
On Chrome 16.x.x or Firefox 3.6, I have a UI application with a panel, a textbox and a button.
Here is my application creation code:
// Create my application
var mydoc = SpreadsheetApp.getActiveSpreadsheet();
var myapp = UiApp.createApplication();
myapp.setTitle("Translation selector");
// create panels, text boxes and widgets
var mypanel = myapp.createVerticalPanel();
// Create input boxes and button
var textBoxA = myapp.createTextBox();
textBoxA.setName('Input search filter here').setId('SearchText');
var MyButton = myapp.createButton("Fill the tables");
mypanel.add(textBoxA);
mypanel.add(MyButton);
// create handler to respond to events
var clickHandler = myapp.createServerClickHandler("respondToSubmit");
MyButton.addClickHandler(clickHandler);
clickHandler.addCallbackElement(mypanel);
// assemble everything in app
myapp.add(mypanel);
//mydoc.show(myapp);
//return myapp;
var doc = SpreadsheetApp.getActive();
// show the app
doc.show(myapp);
}
I've a similar issue on Chrome 21.0.1180.89 for OSX. Working with a mail merge script which worked perfectly on a, similar up-to-date, chrome on Win8 just a few hours ago.
I'm pretty sure it's a security issue.
De-authorising the app (under account->security) and then reloading the script and re-authorising it helps. Not sure if it's on a per-browser level or something else..
Kindly Add this Code,
As per your question, It works on chrome.
function saveTextAsFile()
{
var textToWrite = document.getElementById('area').value;
var textFileAsBlob = new Blob([textToWrite], {type:'text/plain'});
var fileNameToSaveAs = "ecc.plist"/*Your file name*/;
var downloadLink = document.createElement("a");
downloadLink.download = fileNameToSaveAs;
downloadLink.innerHTML = "Download File";
if (window.webkitURL != null)
{
// Chrome allows the link to be clicked
// without actually adding it to the DOM.
downloadLink.href =
window.webkitURL.createObjectURL(textFileAsBlob);
}
else
{
// Firefox requires the link to be added to the DOM
// before it can be clicked.
downloadLink.href = window.URL.createObjectURL(textFileAsBlob);
downloadLink.onclick = destroyClickedElement;
downloadLink.style.display = "none";
document.body.appendChild(downloadLink);
}
downloadLink.click();
}
I have some users of a script I've developed, FormEmailer (available in the Script Gallery) that are also having this problem. But we were not able to nail the situation that generates this yet.
Is the spreadsheet you're testing yours? Or is it shared and you're not the owner? Do you have other scripts projects on this same spreadsheet? Are you the owner of all scripts?
(I think it's better if you change you edit your question and I my answer, instead of talking in the "limited" comments).
I have the same problem :
More details about this after a few tests. It seems it is due both to user triggering the script to execute, as well as characteristics of the trigger :
- if the function is called from a custom menu in a spreadsheet, everything works fine for everyone
- if function is called onOpen(), everything works fine for everyone
- if an installable onEdit or onOpen trigger has been set on the function, then everything works fine for the person who set it, and bad for others.
The last behavior is observed whether that person is owner or not.
Basically it seems the only times when it doesn't work well is when someone opens or edits a spreadsheet and the function is triggered by an installable trigger installed by somebody else.
This is a pain.

How can I tell if an AirPrint printer is available?

I have an option to print in my iPhone app.
On pressing the 'Print' button, UIPrintInteractionController is presented. The issue is that I want to show an alert on pressing the print button if no printers are connected.
I tried several options like [UIPrintInteractionController canPrintData:dataFromPath] but these options never worked.
From the docs:
if ([UIPrintInteractionController isPrintingAvailable]) {
//Printing is OK
}
else {
//Printing is not ok
}

How to Bind Load event for Image in jQueryMobile

I have a mobile website running jQuery Mobile 1.0a2 and I'm currently testing in Mobile Safari for Firmware 4.1 via the iPhone Simulator.
I cannot seem to bind to the load event for an image.
I have a simple gallery of thumbnails and a large image. When you click on a thumbnail it changes the src attribute of the main img
The js for that uses the live('click' method to bind and it works just fine.
$('.gallery-navigation img').live('click',function() {
// change source of main image to new
$.mobile.pageLoading(); // show jquerymobile loading message
});
My problem is that I need feedback on this click, so I wanted to show a loading message (provided by jquerymobile) and then hide it once the image loads.
Where #gallery_image_large is the actual <img> where the src is changing, I tried the following:
$("#gallery_image_large").bind("load", function () {
$.mobile.pageLoading(true); // hide jquerymobile loading message
});
This works in Safari on my desktop but does not in the iPhone Simulator mentioned above.
For reference:
jQuery Mobile Loading Message Methods
UPDATE: I am experimenting with JQuery Image load fails on MobiOne iPhone simulator, which explains how to implement the .load manually by "checking .complete".
I changed the structure of my jquery and it's seemed to have fixed it!
$('#gallery_image_large').one('load',function() {
try { // a grade
$.mobile.pageLoading(true);
} catch(err) { // low grade
}
}).attr('src',full_src);
(as you can see, I opt'd for a try { .. } catch { .. } to verify jquerymobile is available.
Although I didn't use the solution (directly) from JQuery Image load fails on MobiOne iPhone simulator, the manual firing of load via .complete is probably a good solution for anyone else out there!