Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

XcodeNewb

macrumors member
Original poster
Feb 6, 2009
79
0
Is it possible to send email in an application without opening up Apple's mail app?

OK, I know it is possible because I see other apps do it. So how do they do it behind the scenes?

Thanks
 

XcodeNewb

macrumors member
Original poster
Feb 6, 2009
79
0
There are a couple out there. I'm sure they are using an smtp client in the background. I found some open source code project called skpsmtpmessage but I don't know how to use it.
 

fishkorp

macrumors 68030
Apr 10, 2006
2,536
650
Ellicott City, MD
The way HaHaHa worked it would ask what address you want it sent to. You typed in the address. It then emailed the image to the address you typed in from whatever address they had setup in the app.
 

chbeer

macrumors member
Sep 22, 2008
82
0
Berlin
I think the easiest way would be to have a server side script (PHP, CGI, etc.) that you call from your app. Then you can send a mail, write a file, insert data into a DB or what you like...
 

fenrus110

macrumors regular
Mar 24, 2008
142
0
The way HaHaHa worked it would ask what address you want it sent to. You typed in the address. It then emailed the image to the address you typed in from whatever address they had setup in the app.

I think the easiest way would be to have a server side script (PHP, CGI, etc.) that you call from your app. Then you can send a mail, write a file, insert data into a DB or what you like...

This leads me to believe that it was done on a server side. Like it sent an HTTP request to a server with parameters on what to include in the email.

But if it magically knew what the FROM address was based on our email client, then there is a chance it was done all from within the phone.
 

fishkorp

macrumors 68030
Apr 10, 2006
2,536
650
Ellicott City, MD
This leads me to believe that it was done on a server side. Like it sent an HTTP request to a server with parameters on what to include in the email.

But if it magically knew what the FROM address was based on our email client, then there is a chance it was done all from within the phone.

The email was "from" the app address, not the person using the app. So it was like from "hahahaapp@warnerbros.com" or something (not really, but you get the point). So it's not sending emails in the background as the app user. In order to do that you need to have a settings section where the app user will enter their from address, you can't pull from the Mail.app (and of course you'd then need proper SMTP information, otherwise you'd be spoofing their address and I'm sure Apple will reject it). If you want the app to silently send as the user of the app, I don't think it will happen unless you ask them for ALL of their SMTP info in some sort of settings section. Using the app user's information to do something like that is also probably a privacy issue, so Apple would make you warn/notify the user that you are doing it. Or they could decide to just flat out reject the app :p Unless I'm totally misunderstanding what you're trying to accomplish?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.