How to disable keyboard in MFMailComposeViewController?

Hi,


I want to send the user's purchase information to my e-mail, particularly OpenSSL verfied Receipts. I already have the info, I just don't want users to play with it.


What's the best approach to do this? I know about the server side but I'm looking for something more simple yet secure. Is a there a way deny users from editing the email and only allow them to send it or cancel it? maybe disable the keyboard?



Thanks

Replies

"What's the best approach to do this?" Why on Earth are you trying to e-mail the user's purchase information to yourself, instead of constructing an actual purchasing system that's going to be secure? Sending the information to your own server is both simple and secure.


Note that you're not allowed to interfere with the user editing and/or canceling the e-mail message if you attempt to send it using MFMailComposer. Trying to do so will get your app rejected at best, or get your app broken without warning in the future.

Why on earth? because I can validate form the user's device using their information avoiding the middle punk interfering with the server.


How can make that "actual purchasing system"? Better yet, do you know an email server I could use in iOS to send emails to self? I looked into Google's SKPSMTPMessage but it's a compelete outdate junk and doesn't work.

Please go back to square one and explain one really important thing. You want to e-mail some informtion from the user's device to you. And then what?



If you're trying to claim that you're going to be processing the e-mail messages usin some automated script, then please note several important points:

0. If you had read the MFMailComposerViewController documentation, you wouldn't have asked this question.

  1. People have more than one e-mail account. Guess which one MFMailComposer is going to default to, and how often you're going to cause problems because it's the wrong (sometimes even -legally- wrong) account to send from.
  2. Paranoid environments that have outgoing mail disabled. Or paranoid users who have outgoing mail disabled. In an extremely paranoid environment, the device user at least has a chance of whitelisting HTTP traffic to your webserver to post whatever information you're trying to send yourself.
  3. If you have a mail server that you're running an automated script on, it's less work to set up an HTTP server and a CGI script to accept the same information. And it can be validated and processed upon receipt.

Then I validate the receipt and deliver the goods.


1. It doesn't matter how many email account the user has.

2. They just need to send me that email, no servers or scripts required.

3. It's nothing fancy here. I actually found a way to force them to Cancel or Sent it to me, without messing with it's contents.

>Is a there a way deny users from editing the email

Those naive hopes went out the window two decades ago.

I have been using SKPSMTPMessage for a couple of years to send email from iPhone.

https://github.com/kailoa/iphone-smtp


It has worked flawlessly until recently when Apple did something to the smtp.mail.me.com server

It still works with gmail servers though.


I get an error 550 from the Apple mail server.

S: 550 5.7.0 From address is not one of your addresses


Does anyone know what might have changed on the Apple Mail server in the past few days?

I am wondering if they no longer allow email relaying.


2/13/19 Update

It is working with smtp.mail.me.com again.

Looks like Apple fixed whatever was wrong with the mail server.