Open an email in the native iOS email application from a webpage - ios

I'd like to create an email "file" (i.e. stored on my webserver) that can be accessed through a link on a webpage and which will open the native iOS email program and have the To, CC, BCC, Subject and Body filled in. Additionally I'd like the email to have an attachment. Is this possible?

If you are referring to the usage of <a href="mailto:someone#somwehere.com"> then I'm afraid the answer is no. More details in this question/answer.
This can be done, though it requires the use of PhoneGap/Cordova. This however, requires an iOS app containment. You can have the app communicate with your server. I'm assuming though, that you have a server hosted webapp and require this functionality.
If this is the case, the standard way to do this is to send the email on the server side. This of course, will not use the native iOS email application. If you don't have access to you own mail server, you can use a gmail account as an SMTP server. If your server is written in Java you can use JavaMailSender. If your server is written in Ruby, use the Mail gem. If your server is written in node, use NodeMailer. Most popular languages will have a Mail Library suitable for you needs.

Related

Trigger Request for Slack's Magic Login Email

I'm building a small email app (on iOS first) for internal team use only. We also have a Slack team that I'm rolling out to the whole group (about 250 people) around the same time I'm launching the app.
I'm going to have a lot of older and tech-phobic users, so I'm trying to make things as easy as possible for them. Since I'm writing the email app, I figure to making on-boarding even easier I can:
Check if they've got the Slack app installed (via the canOpenURL method)
Send them to the App Store to download if they don't
Open the Slack app for them if they do
Look for the magic login email
Automatically open the URL from the email.
All that is great, but it would be fantastic if I could trigger sending that email automatically and don't even need to send them to manually put in the team URL and their email. Anybody know a way?
CLARIFICATION:
One big reason I want to do this that I didn't make very clear is that when the Slack app sends the email it prompts you to go to your email app to receive your login link, but since iOS doesn't allow changing the default email app, it will send them to the wrong one for my user's purposes.
Sure. If you already have the emails of your target group you can generate the invitation mails programmatically with a small script.
You will need to use the undocumented API method users.admin.invite for that.

Features of Mandrill API

I am new to Mandrill and its integration. Can anyone help me to figure out the advantages of using Mandrill? What can be done using Mandrill other than sending messages and tracking them?
Mandrill has many uses. You might have seen those on their website itself. Actually its a Mail Transaporter like PHP mailer, but it uses their own server for sending mails.
As said on their website,
Mandrill runs on a globally distributed infrastructure that can
deliver emails in milliseconds.
This is because when you send a mail through their SMTP or send.json (API) method, the send mail possibly see the fastest path algorithm to deliver a mail. That's why it take milliseconds to deliver. They have ~7 different mail servers worldwide for this.
Major Features,
Sending mails fastly than our own server using PHP Mailer.
Sending mails via pre-designed templates which can be reusable by the merge vars we're using.
Support multiple language platforms like, cURL, JSON, Python, PHP, Ruby, Nodejs, Dart and also their depending frameworks.
It tracks clicks from the mail we sent. For Ex: each and every url link in our sent mails is redirected only after tracking from mandrillapp site. This enables mandrill to track the no of opens in a mail and track analytics.
Through mandrill we can construct our own mail sending application or integrate into an existing application.
It's mostly used for Transactional Messages like functions like welcome mail, forgot password, cart details and etc.
It can be integrated into other shopping cart web applications.
Their api call works on even in the developer environment.
Lesser spam.
Verified domain options like DKIM and SPF settings. This enables the mails to identified by major email providers like gmail, google, etc.
It can be used as SMTP version and can be integrated into major SMTP applications.
Reports: Demographics of email send, Compare status, Which url in our mails has been clicked and no of counts.
Setup rule for delivering emails.
A/B testing, custom SMTP headers, Inbound domains and etc.
There are many other features in developer perspective. If you mention in which platform you're trying to use mandrill addditional details can be provide.
Hope this might help you.
To name a few, You can
1) use templates to do A/B testing ( which allow you to experiment with different templates, and end up with something which is effective).
2) use Embedded images , which will reduce the chance that your emails will end up in spam.
Hope this helps,

cordova hybrid Email client app

I have been asked to create an Email client for Android/ios.
I have been looking at Cordova to create this email client app.
There is a cordova-plugin-email-composer plugin to send mails, but I am wondering how to receive Emails through Imap, and store them.
Can anyone advise on this? Or maybe suggest an alternative for Cordova to create a hybrid mail client app?
SMTP (sending mails) is the easier task in cordova, even with mailto:yourname#mailserver.com?subject=...&body=... in the href-attribute in HTML5 you can send an e-mail on mobile devices cross plattform.What you need is a library for IMAP and/or POP3 access in cordova.
I look for the same plugin in Cordova, to write an OpenSource-App as Messenger replacement for WhatsApp using existing Mailserver. This has many advantages:
This OpenSource-App could use existing Infrastructure for sending and receiving messages and attachments as mails. No need to set up new server infrastructure
Messengers like WhatApp are popular and users like that quick communication style.
There is no need to provide my communication to DCC (Data Collecting Company) like Facebook for WhatsApp. Everyone could use the mail server she/or he prefers.
You can receive messages and send messages on a desktop computer with a regular mail client, cross-plattform and cross devices
Basic concept used from AT6FUI

Parsing and Receiving Email in iOS

Suppose I have an email address that only receives a specific type of email, i.e. an automatically generated receipt email from a transaction.
I would like to build an iOS app to receive the email text from this email address and parse according to a predefined format and display the results. Is it possible to do this without dealing with the email server directly from the app?
Meaning can I for instance piggyback off the native mail client (assuming it is set up to receive pushed email sent to the email address). I tried looking through Apple's docs for iOS but could not find anything useful. Anyone know of something?
3rd party apps have no way to integrate with the Mail app or to make use of any configured mail account the user has setup on the device.
However, you can write an app that can access external email accounts if the user provides all of the usual email account details. The App Store has several 3rd party mail apps that serve as replacements for Apple's Mail app.
If your app is written to work with a specific email account, and not one entered by the user of the app, then you can hardcode all of the account details in the app.
Your app is basically a run of the mill email client. You just have to know how to access IMAP or POP3 accounts, retrieve the emails, and process them as needed.
Again, there is no way your app can intercept or make use of any emails accessed by any email accounts the user has setup for use with the standard Mail app.
There are at least two aspects to your question:
How do I get an email to open in my iOS app?
Put the data in an attachment and see this link
What format can I use in an email attachment to transport persistent
objects?
I've had decent results with NSKeyedArchive as an interchange format. There are lots of other choices, depending on what generates the receipts attachments.
Post a followup with your choices. Good luck!

Way to up incoming and outgoing mail for a custom mobile app

I am used to building apps in larger infrastructures. In a startup, how do I setup SMTP for a mobile app? Is there a place I can use for hosting this?
There are a couple of possible approaches:
One option is to not attempt to interface with SMTP/IMAP/POP servers directly in your app. You can, alternatively, send emails from your app via MFMessageComposeViewController, which gives you a standard compose email user interface. This is very easy to do.
To handle inbound emails you can let the user receive their emails via the standard Mail app (that way users don't have to go to different places to receive their emails). You integrate inbound emails with your app using a custom URL scheme. You can then send the user an email using this custom URL scheme, and if they get the mail on their iOS device and have that app installed, when they click on the link they will be taken to your app, passing it information from the URL in the email.
For example, if you defined a custom URL scheme of yourapp://, you can just include a hyperlink to that URL in your email (or text message or your web site), and if the user is on their iOS device, when they click on that link, they'll be taken to your app. If you google "iOS custom URL scheme tutorial", you'll see examples of the plist entries you need to make in your app for it to respond to a custom URL scheme. The Implementing Custom URL Schemes reference shows you what sort of changes you need to make to your app delegate to actually pass data in your custom URL to your app.
Alternatively, you can (a) sign up with any Internet Service Provider (ISP) that offers mail hosting; (b) write an app that sends email by connecting to that ISP's SMTP server; and (c) retrieve email by connecting to that ISP's IMAP or POP servers. Clearly you'll have to pay fees to the ISP, the quality of your app is linked to the quality of the ISP you partner with (so pick a good one), and you'll have to do your own SMTP/IMAP/POP integration in your app (and you'll have to write your own code to do that or use a third-party library for that, as this is not standard Cocoa Touch functionality). In my opinion, you'd need a pretty compelling business case to go down this road, though it can be done.
You could avoid email altogether, and develop a web service for letting the users send and receive messages. (This might make sense if the app is just sending messages between users of your app, for example.) Again, you'll have to contract with an ISP for web hosting, and you'll of course have to undertake the non-trivial exercise of writing your web service code. But this is architecturally cleaner than integrating with SMTP/IMAP/POP servers if the purpose of your app to facilitate communication between users of your app.
You haven't provided enough information for us to assess which approach best suits your situation.

Resources