sending email in the background

Discussion in 'iOS Programming' started by XcodeNewb, Mar 11, 2009.

  1. XcodeNewb macrumors member

    Joined:
    Feb 6, 2009
    #1
    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
     
  2. KoolStar macrumors demi-god

    KoolStar

    Joined:
    Oct 16, 2006
    Location:
    Kentucky
  3. XcodeNewb thread starter macrumors member

    Joined:
    Feb 6, 2009
    #3
    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.
     
  4. fishkorp macrumors 68020

    fishkorp

    Joined:
    Apr 10, 2006
    Location:
    Ellicott City, MD
    #4
    The HaHaHa app used to promote The Dark Knight did this. I'm not sure what they used though.
     
  5. fenrus110 macrumors regular

    Joined:
    Mar 24, 2008
    #5
  6. fishkorp macrumors 68020

    fishkorp

    Joined:
    Apr 10, 2006
    Location:
    Ellicott City, MD
    #6
    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.
     
  7. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #7
    Yes, but how did it email the image? That is the trick!
     
  8. chbeer macrumors member

    chbeer

    Joined:
    Sep 22, 2008
    Location:
    Berlin
    #8
    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...
     
  9. fenrus110 macrumors regular

    Joined:
    Mar 24, 2008
    #9
    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.
     
  10. fishkorp macrumors 68020

    fishkorp

    Joined:
    Apr 10, 2006
    Location:
    Ellicott City, MD
    #10
    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?
     

Share This Page