Sending E-Mail on iPhone - A Better Approach (plus possible issues..) - iphone

I have this app which has an e-mail feature. When the e-mail window appears theres a recipient, subject and template text that asks for a few numbers and a name to be filled in to the gaps.
However I would like to approach this in a slightly better way. For example I would like a text box and a few drop down boxes in a view with a "Submit" button that, when pressed, would send an e-mail in the same format as above, but the required data would be filled in from the data the user has inputted via the drop-down menu/text box instead of having the user enter the information directly into an e-mail.
First of all, does Apple like this? I've heard they are not fans of sending e-mail in this way. (In the background).
Secondly, if Apple would approve of this, how would one go about implementing such a feature?
Thanks,
Jack

I can't speak to the policy issue, but there's no way for you to send a mail from the device (ie from the user's account) yourself without their UI.
If you want to accomplish this, you'll need your own server somewhere that you post the email messages to, and send on the back end from your own email account. This is probably not what you're after, but it would work.
If all you want to do is prepopulate some data in the email message, you can certainly give the user your picker controls, let them set it up, and then pop open the mail composer UI with all the message body pre-cooked. They'll still have to press "Send", but you can own the UI up until that point.

Related

How to know that an email message was read?

I have a software that sends notifications, quotes and invoices to "clients of my clients" by email. Sometimes people don't answer it very fast, so someone needs to call by phone to confirm if they received and get the feedback. I would like to automate this, to know if them, at least, read the email. I know this is very difficult due to how email works, but some companies already try to do this in a satisfactory way, like:
mailgun.com
mailchimp.com
sendwithus.com (YCombinator funded).
In HTML mail messages we can create a resource that points to the server, like a image. But mail clients usually ask permission to the user to load the images. So, problem
here.
But for text mail messages? Is there any way to know the email was read? How companies these companies do?
PS: I don't know what tags is the best to classify my answer, I shall appreciate any edit.
There is no way to be 100% sure if a email was opened, because of its architecture. There are some techniques to do this, but it always depends of user actions and mail client configurations. But:
For HTML messages you can use images and/or the return receipts (RFC 3798).
For text based messages you can use only the return receipts (RFC 3798).
About opening tracking:
Opens are tracked by including a transparent .png file, which will
only work if there is an HTML component to the email (i.e., text only
emails will not track opens). You should note that many email service
providers disable images by default, so this data will only show up if
the recipient clicks on display images button in his/her email.
(Text extracted from mailgun.com user docs)
References:
MailGun.com documentation.
Previous discutions on this thread.
As arnt says, you're fighting the design and basic operation of e-mail. Whenever you send a mail, there is a boundary between a MTA you control (or at least have an account on) and a MTA that is responsible for your target user's mail. What you can know is whether the user's MTA accepted the mail for delivery. Whatever happens afterwards is outside of your control.
Consider an example of a snail mail. When the package enters the recipient's box, you won't know whether they put the whole unopened envelope to a trash bin, or whether they opened is and read the contents very carefully. You can approximate that goal by using crude measures (like embedding a webcam-and-a-computer which will activate upon envelope opening and send you the snapshot of the face of the opener via a cell phone), but doing so is unreliable, unethical, and probably illegal in plenty of countries.
The "return receipts" or embedded image links are similar -- because the whole e-mail is already in the hands of the user's SW, they can do anything with it. A good MUA will probably ask before sending out dumb return receipts, and it also won't load remote images in HTML mail (because it's easy to create an http://trackme.example.org/mail/for/user/12345/message/666/image.png and have a database which says "hey, this URL belongs to Mr. Pichler, and is used in the first message we sent him). The most you can do is to ask nicely, and return receipts (RFC 3798) are a machine-readable way of doing just that.

How to customize the default message composer in iphone sdk?

I need to customize the default message composer as at To: I need to diplay the recipient number and body contains an automatic message.Can it possible to send this message without user interaction as he need not to be tap on to the send button.
Thanks to all,
Monish.
The documentation for MFMessageComposeViewController shows that you can programmatically set the body and the recipients of a text message. It does not, however, expose an API to send the message automatically. The framework requires user interaction.
It would be a terrible thing if an app could send a text message without user intervention. If that were possible, then apps could fire off as many text messages as they wanted, to whomever they wanted, all while charges are getting applied to the user's cell phone bill. That's a lawsuit waiting to happen.
So in a nutshell, you can pre-fill in some stuff, but the user will still have to tap the "Send" button.
No. You may add recipients and put what you like in the body of the message, but the user will always see the message and will be able to modify it. The user has to choose to send it.
If you need to do this automatically, you'll need to implement enough of SMTP to be able to send messages on your own, without the help of the mail framework.

Custom email form in iPhone app?

Say I want to send email to my server, but I want the user to not see my address, or perhaps I want the subject to be preset. What if I want to email the value of a UISlider or other UI element without the user seeing the whole email view. How can I do that?
Must I use an Apple class, or can I use my own UITextFields?
The benefit of the Apple class is that you get the email address of the user. If you do not care about that, you can submit anything you want to your own server as POST data or by whatever means you wish. The interface can look like mail but the functionality will be like a web form.
If you need the address of the user and do not want to ask for it, then you will have to reveal the destination email address. You can specify a subject and body, but the user will be able to modify it.

How to insure MFMailComposeViewController doesnt send email when body is not empty?

I have MFMailComposeViewController in my app in order to allow the user easily email me about suggestions and feedback on the app but I get about 3 emails a day which are just empty in the body or just the users email signature.
Is there any way of checking if the body of an email is not empty before it is sent with MFMailComposeViewController?
This is not a programming answer, and might be a bit off topic, but I have released a few apps with similar functionality, and have seen the same thing.
I have also talked with a few of the users who have sent in empty emails, and have learned that sometimes they sere just trying out the various functions of the App, and sometimes they get to the feedback page, but don't want to take the time to type out an email on their phone.
I would think of this as more of a customer service problem, and less of a programming challenge. I would use the opportunity to follow up with the users who send the empty emails. (At least now you have their email - if you don't let them send the form without a body you will likely never get it.) One option is to send a standard follow-up email that says you received an empty email from them and would love to hear their feedback on your product. (Perhaps even send them a quick survey) .
Once you have displayed the MFMailComposeViewController's view you cannot get at the message or control the behaviour. You cannot stop people sending empty mails.
If you really want to do this you will have to write a replacement view and controller. It is probably easier to filter the blank mails at the receiving end though :-)

Tracking email bounces, opens, clicks

I found How do you make sure email you send programmatically is not automatically marked as spam? to (hopefully) be a solid guide to avoiding being marked as spam. Are there any other important tips/suggestions?
How do I track bounces,opens,clicks?
These are features found in paid services like Mail Chimp and Campaign Monitor.
Do the same as Mail Chimp and Campaign Monitor then. LIE about your stats.
There is no accurate way to track emails. If there was it'd just get blocked again. Most people don't want you to know these things and most email software ensures you don't. The stats provided by email tracking services are bogus.
Consider:
Most spam services will detect image
'bugs' and flag you as spam.
Image bugs don't do anything until
the user clicks 'show images'. This
does not mean they didn't open or
read it without images. How can you tell if a mail service downloaded the image preemptively to cache it or check it for image spam?
It can be difficult to determine the difference between a bounce and a reply due to differences in mail servers.
Only clicks can be tracked by redirecting through your server. Even then who can say that mail services won't start processing links in emails to determine whether the email is spam?
Opens can be tracked using a 1x1 picture file in an email. However, this is the same tactic that spammers use to validate email address existence, so you'll be fighting on the same side in that regard, unfortunately.
Clicks can be tracked by assigning a unique identifier to each link, determined by two variables: the URL that was clicked and the email address that clicked it. You can, for example, determine these on-send and store them in a database with the same unique identifier.
Bounces should bounce back to you with the email address intact.
I was looking at the email facebook sends out. In addition to an image, they use a bgsound element as a tracking bug like this:
<bgsound src="http://www.facebook.com/email_open_log_pic.php?mid=99999999&s=a"
volume="-10000" />
I'm guessing the bgsound src is fetched by some readers when the images are off.
Check out Ask MailChimp: How do you track email opens?
if you really want to track bounces, use a service like Email Delivered (www.emaildelivered.com)
i also use Return Path (www.returnpath.com) for a really good reading on whats being delivered to the inbox vs spam box and what esp's are totally rejecting my mail.
Two ideas, clicking links, and statistical fudgery.
Clickthroughs
I would like to add that you can mark emails as read by a user clicking a "view this email online" or by tracking click-throughs. If a user clicks on any <a> tag in your email, send it to a script first that logs the email as read and marks which link they clicked on. This will give you can get a more accurate number.
Stats
I wonder if there is any research into how many users don't show images. That way you could 'statistically' correct for the lower open counts. Just did a bit of reading and found:
A 2009 report from Merkle states that only 48% of email recipients see
images automatically. This means that if an email campaign relies
heavily on images, it’s probably not being read by over half of its
intended recipients. Source
The same site says:
In the latest MarketingSherpa Email Marketing Benchmark Report (2010), a survey of email recipients found that only 33% have images turned on by default.
Somewhere in between there could be a useful figure (35-40%) of users not displaying images in emails. That doesn't necessarily say that those users are opening the emails. Just that auto-displaying images isn't enabled.
If anyone can come up with some more facts/stats, we could potentially get a correction factor. Just with this information I don't think you can do much other than marketing smoke-and-mirrors. For example, 30% opened the emails. Based on 35% of users not displaying images, that means ~9% of users didn't display images, but explicitly chose to turn them on for this email (not really, but just go with it). Let's say that leaves 26% to unaccounted for. You could "correct" your 30% to 56%! All with the magic of bogus stats and a touch of marketing.