I'm composing my messages using images, text and audio files and finally showing the preview in Webview. Now, I want to send what ever it is showing in web view as mail. Even images and audio files must be sent so that end user has just to see the message with all images and aduio files as in original message.
Is it possible?
Send the actual HTML of the web page. Be sure to set the in the page, so any links in the page will be referenced relative to the original URL. There are upsides and downsides to this method:
UPSIDE: Small file will be sent - just the HTML of the base page
DOWNSIDE: Any images and sounds will not be sent in the message - and will have to be downloaded by the users email client from the original URL when the page is viewed. (Any web client that supports HTML content type will be able to do this.)
Don't forget to set the content (MIME) type of the email message to TEXT/HTML.
Related
When creating a message and using it to create a draft or email using the Gmail API, can you have an image embedded in the body? I'm looking to have the image data actually embedded similar to how copying and pasting an image (the actual data, not the link) into a Gmail email will place the image right in the content.
Can it be done like this or do I need to upload the image to some other location and use HTML to embed the image in the email? Any pointers on how to do it?
The short answer is that you would do this the same way you would for any email service.
The long answer is that you need to create a multipart/related message, where one part is the HTML content of the email and the other part is the image. The image part contains a Content-ID header that specifies an ID for the image, and the HTML image tag references that ID in the src attribute using the format cid:ID_HERE.
An example of how to construct such an email in Python is here: https://stackoverflow.com/a/1633493
P.S. - A great way to see how emails are constructed is to look at the raw message. You can look at the raw message for a given email in Gmail by clicking the drop down arrow next to the message and selecting "Show original".
I am not sure if this is grounds of app rejection or not:
In my app I receive JSON data from webserver and it has html content like
"[html] a href www.mycompany/view/regulations.html"... click for regulations...[/html]"
Is it okay to show the contents of the url above when clicking on "Click for regulations" link, or will this be rejected because I am under the impression that all html has to be carried locally?
That shouldn't be a problem. We have an app were our TOS is loaded from an (online) URL. What they usually don't like if your code loads from an external source.
I have a UIWebView in my view controller. This UIWebView shows a PDF file. I have created a button. When the user clicks on this button, I want to send the content of the UIWebView via email. As a template I use the MailComposer from Apple. In this template Apple isn't using a UIWebView. Apple uses local stored data which works fine. So I am looking to send the content of the UIWebView, my displayed PDF, but I don't know how to do this.
Thanks.
You could try using -stringByEvaluatingJavaScriptFromString: to get the HTML content of the page and using -setMessageBody:isHTML: to set the message body. You may want use a <base /> tag, though, to set the page's base URL so relative URLs function.
Edit
You could download the PDF and use addAttachmentData:mimeType:fileName: to attach the PDF to an email.
What you will need to do is download the pdf and save it on the device and then attach it as per Apple' example.
see one approach to downloading here
I am using custom url schemes. I can send string messages as parameters to my custom url and emailing this to any person. When any person opens this email attachment in device in it open my app installed in device with the passed parameters in my custom url.
Similarly how to email an image via custom url and when any person opens this attachment the image is passed to my app in device.
I tried to encode the image in base64 format and tried to append to my url,but not working.
Any ideas??
Thanks in advance
While there technically isn't a limit placed on url length by the standards, in practice, there is (see these two questions here on SO).
My guess is that you're running into that limit.
I'm trying to cache the mobile Gmail webpage because UIWebView does not cache the content itself (mobile safari does, but not UIWebView).
I tried the methods listed here Reading HTML content from a UIWebView basically saving the html either directly from URLRequest or from UIWebView itself. When I try to put the html saved back into UIWebView it is not the same page!
This is the page that I want to save
alt text http://img39.imageshack.us/img39/5679/screenshot20090830at123.png
This is the page that the html saved will display
alt text http://img39.imageshack.us/img39/8734/screenshot20090830at122.png
If you're loading using loadData:MIMEType:textEncodingName:baseURL: make sure you're setting baseURL correctly - that way, the WebView will know where to look for relative stylesheets and so on.
Edit: For example, if I was saving this page, I'd set the base URL to Just can't seem to fetch the mobile Gmail html, what is wrong?.
That looks like the same page to me, but with different stylesheets attached. If you're just re-displaying identical HTML from your local server, the relative stylesheet paths in Google's HTML would no longer be correct. Also, any AJAX requests meant to run after the page loads would no longer work (both because the relative paths to the scripts would be wrong, and also because Cross-Site Scripting restrictions would prevent them from contacting Google).
Attempting to scrape content from an AJAX-enabled application is no small undertaking. You'd have to replicate a lot of GMail's functionality to truly reproduce the exact page Google presents.