Best way to send a bunch of emails without user input on iOS? - iphone

First, let me get this out of the way and say this isn't a spam application. I'm writing an app that allows users to share files with multiple friends easily via email.
Right now, I'm using SKPSMTPMessage to send out emails to a list of recipients at the user's request. It works, but I wonder if there isn't a better solution here. For example, if it might be better to send the smtp info and attachments to my server, and conduct the sending from there in order to avoid repetitive attachment uploads on the device.
I am also considering how to handle cases where there is no connection available (determining connection error vs other kinds of errors and persisting the failed message for a later retry).
Any advice on the best way to structure this service would be greatly appreciated.

In order to customize the user experience for sending e-mail you need access to their email details, IMAP, POP, etc. if you want that user to be the one sending the e-mail.
The solution I use is to have the from address be an e-mail I control and use a 3rd party email provider, ex: SendGrid, PostMark, Mandrill and plug in to their api's to send e-mails.

Related

Send emails from flutter application without expenses or smtp server and without opening the gmail app

As the title says, I would like to know if there is any way to send emails without having to use an external service, that charges me for sending the messages, or having to use an SMTP server in which each user has to be registered.
I have also seen pages like email.js but I don't want to have to pay for that if there is a possibility to do it on my own. It is also not useful for me to open the Gmail or messaging application of the device itself since I already know how to do that and it is not what I want.
For better understanding, I will give an example of what I want to do.
What I want is that from my application the user writes a message and from there that email message is sent to several different users from a list, without having to log in or anything, since the emails will be sent from my own email account. gmail that I have specifically created for the application.
I have seen the smtp server but from the information that I have seen that server implies that I have to log in to be able to have the token and that is not what I want because I want that once I configure everything there is no need to do anything else that people receive your messages and that's it.
I don't know if this is possible but I hope someone can help me.
Sending emails without your user logging in would require you to have either the credentials stored in the app (which is unsafe) or use a custom backend server that will host all the credentials that cannot be extracted. I would advise going with the backend route because it is easier to setup and your application will simply perform a HTTP request to get it done.
From the documentation of the mailer package, you can implement the server method pretty easily and get it moving. You will have to find a free web hosting service to deploy to.
There would really be otherwise no other way to get what you desire for virtually free.

How to get user informations by email

I'm new in swift programming and I'm working on simple app. However, I was wondering if I can build "Contact us" view controller where the user enters his message and his data sent to me by email. Is it possible?
example:
There are two approaches to send mail from iPhone SDK
You could try MFMailComposeViewController to send an email.
You could set up a web server from where you could send the email with the help of web services.
I’ll suggest building a web service, post this data as a JSON object, make a fancy email at server end and shot it to concerned email id, you have an option to do any additional task.
Like storing a data to db, tagging it specific way and filtering emails from blacklisted email ids.
You can use mail gun or mail trap to help you setup simple way.

Email Server to only handle inbound messaging and routing

Was hoping for some ideas as to a service to which I can set up an inbound-only email system. In other words, I will have multiple users on the system, each can receive their own email... but at the moment... at this time, I am not focused on the ability to send or reply to messages, only receive them and send to the appropriate user. I looked into Postmark... They seem to have some great functionality.
CloudMailin Is another alternative. However there are effectively three options for setting up something like this.
Use an existing, traditional, email server and poll for the emails
Setup your own email server and create a script to run when you receive an email
Use a third party solution, as you've already mentioned.
I went through for of these for Rails a little while back here, but all the information is still relevant.

How do I prevent spammers from exploiting my Google App Engine form that sends email to others?

I'm making a quick Google App Engine program that presents a publicly available form that users can fill out with their name and email address, then can enter a friend's name and e-mail address. The application pulls in the data via POST, then sends a pre-formatted e-mail like 'Hi, , your friend wants to invite you...'
What should I be doing to prevent spammers from exploiting this publicly facing e-mail sending program? Is there a good resource for best-practices in this field? I've spent a few hours searching, but I haven't really found anything definitive...
Principally creating a publicly available form that anyone can use to send[s] a pre-formatted e-mail is another name for creating a spam machine.
You can mitigate by making it harder for non-humans to use it, recaptcha is the typical way to achieve this.
You could send a confirmation email to the sender and require a secondary action (like clicking a link) before sending the email. Or, if you expect your users to return, ask them to sign up (with a similar confirmation) before allowing them to send email.
I would first impose some limit to the # of email addresses a specific user/IP can send. This won't solve the problem but will limit the damage in case someone does try to send spam to 1000 emails.
Second, you could try sending the emails in small batches if an user puts in a lot of email addresses. Send 5 at a time, and monitor to see if there's any spam complaints (you can probably automate this somehow). If no complaints after 2 days, keep sending the rest.

Send mail without MFMailComposeViewController

I want to send mail from an iPhone app without showing an MFMailComposeViewController. I also want this mail to be sent from the user's default Mail account. Is it possible to do this?
This is not supported by the iPhone SDK, probably because Apple doesn't want you to do it.
Why not? My guess: Because it's easy to abuse. If we knew user's email address, we could spam them, we could fake emails from them, etc. Imagine finding out an iPhone app sent an email as you without your knowledge -- not cool, even if the app had good intentions.
So, anything you do to get around that, is likely to get you rejected from the app store.
Having said all that, you could basically write your own smtp interaction code to chat with the user's outgoing mail server. For example, if the user has a gmail account, you could ask them for their email and password, you'd have to know how to talk to the gmail servers, and send email through them.
Going that route means asking the user for their username, password, and either asking for or figuring out their mail server information. Another choice is to send directly from the phone (your own smpt server, not just a client), which is a bit more coding. And if you write your own server, the mail you send is more likely to be blocked since your originating IP might not match the domain on the sender's email.
There also exist some libraries that might help out. Previous related question:
Open Source Cocoa/Cocoa-Touch POP3/SMTP library?
There are legitimate reasons for wanting to send an email. (Such as communicating with a server using SMTP instead of HTTP)
This blog post should get you going: http://vafer.org/blog/20080604120118
It is possible to use MFMailComposeViewController without user interaction. See my answer on the iPhone send email not using MessageUI question.