I want to send email in Swift internally while crashing or error generations.
How can I send it internally, in Facebook they open the popup and sent the mail.
How do implement in Swift?
you can't send emails from iOS directly without the users interaction/permission (look over MFMailComposeViewController class). You can use an external services like SendGrid, Mandrill etc.
I am new to iPhone app development. I have a form that the user can fill out to request additional information about my product. I would like the app to automatically send out the email without launching UI.
I have looked through several posts that have recommended using ASIHTTPRequest to "Post" data. However most of the posts are dated back to 2009. My question is that using Xcode 4 is there another way of accomplishing the same thing without using ASIHTTPRequest?
Thanks
T!
If you want to send emails without the standard mail composer you have to
ask the user for his email address
implement SMTP. And SMTP is more complex than a simple POST to http.
Alternatively you could set up a script on a web server to which you send the mail address you got from the user.
Currently when I send a mail message from within an iOS web app (fullscreen from home screen) the web app closes and the mail app opens.
The same thing happens in Color Mail: http://www.apple.com/webapps/productivity/colormail.html. When you send a mail message you are kicked out of the web app.
Is there a way to send a mail message and remain inside the fullscreen web app?
Thanks!
If you want to send an email without using the Apple Mail client (which is basically what you're asking) you'll need to use a web service that support sending email in response to a request.
For example, Amazon's Simple Email Service lets you send email in response to an API query.
However, if what you're after is sending an email message from the user's own account then you unfortunately must exit the app and go into Apple Mail - in much the same way that a mailto: link would do if you used it on a website.
EDIT: IF you were a native app, what you'd be after is the MFMailComposeViewController. It allows you to bring up a standard mail compose interface right within your app.
HOWEVER, since you're not, you're going to have to build your own form interface, and then take the form submission on the web app and send the mail from there.
(Sorry. Didn't read.)
I need to be able to send a pre-formatted email or SMS text message programmatically from within an iphone app. Can this be done? I have looked at apple's MFMailComposeViewController class, but this "provides a standard interface that manages the editing and sending an email message" and the MFMessageComposeViewController class also has it's own "standard system interface for composing SMS text messages". These allow you to present an interface to the user where they have to fill in all the data and then explicitly press a send button.
I cannot use this boilerplate functionality.
I need to be able to send a message without presenting any interface to the user. I know this sounds evil, but actually it is for a commercial application which needs to communicate to a user group in a central office when users in the field have performed specific actions out in the field.
Has anyone found a solution to this?
After much investigation, I have found that sending emails programmatically, without user intervention, from an iphone application, cannot be implemented using any of the apple frameworks.
Set up a web service you can post to using an HTTP request. If you are posting to only one address this can work very well, although you may want to get the user to input their return mail address.
Otherwise only the standard dialog is available (this relies on using whatever account they've setup on the device).
Here are a few SMTP API's that work on OS X. They might work on iOS as well.
Pantomime
MailCore
EdMessage
Only Possible via Web Interface, you can not hide the Interface , this is as per apple Guidlines to Developer and as per documentation
Looking for a solution to such a problem, I found something interesting here: How to send mail from iphone app without showing MFMailComposeViewController?
I hope this will be useful!
This is standard not possible. If you can't use the standard dialog you need to use SMTP.
SMS is the same, use the dialog of use a webbased sms service (most of these cost some money).
I have no experience with iOS, but I have enough experience with email protocols to say I'd be very surprised if a client application could send email without accessing a server. More than likely, the email will be sent using the SMTP protocol and therefore must be sent using an SMTP server. Choosing how you connect to that server is about the only option you have. You could connect to a server-side script (such as php) to generate and send the email, or you may be able to create a socket and connect directly to port 25 on the SMTP server and still generate the email from you client application.
Check out:
RFC 5321 at https://www.rfc-editor.org/rfc/rfc5321
SMTP on Wikipedia at http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
You could always do a low level telnet using SMTP protocol to a known mail server to send a message. I don't know if Apple will reject the app, but SMTP is damned simple.
I want to send an email from my application whenever a user taps the SEND button of my view.I do not want to show the email interface to the user.All the fields needed for email will we filled via my application.So is there anyway to do this???
There is a project on Google Code called skpsmtpmessage which will allow you to send off a faceless email.
Alternatively you could have a look at the Pantomime package. It also contains implementations of the SMTP protocol. It has however not (yet) been ported to iPhone AFAIK, but since it's written in Cocoa it should not be that big a task for doing this specifically for the SMTP part..