mailto: openURL issue

Discussion in 'iOS Development' started by johnmabassa, Jul 10, 2009.

  1. johnmabassa

    johnmabassa Member

    Joined:
    Mar 16, 2009
    Messages:
    87
    Likes Received:
    0
    Hi,

    I have a feature in my app to send mail to others, but I am facing a problem with it.

    Suppose say the user has already opened his mailing client and typed one mail and he hasnt send it. Now if the user opens my app and tries to send the email, the text which he entered in my app gets appended to the mail he already typed using the mailing client, basically it is not opening a new email page , instead it appends to the earlier drafted mail.

    Can anyone give me a solution to this?

    below is my code
    Code:
    	NSURL* mail = [NSURL URLWithString: [NSString stringWithFormat:@"mailto:%@?cc=%@&subject=%@&body=%@",to,cc, subject, body]];
    	[[UIApplication sharedApplication] openURL: mail];
    -John
  2. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    Yeah, forget about mailto: and use the entire framework dedicated to sending emails.
  3. NolesFans

    NolesFans New Member

    Joined:
    Sep 23, 2008
    Messages:
    404
    Likes Received:
    0
    Device:
    iPod touch
  4. johnmabassa

    johnmabassa Member

    Joined:
    Mar 16, 2009
    Messages:
    87
    Likes Received:
    0
  5. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    Why would you still be wanting to compile for 2.2.1 when 3.0 is out.
  6. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    Many iPod Touch users are still using 2.x because they don't want to pay for 3.0
  7. johnmabassa

    johnmabassa Member

    Joined:
    Mar 16, 2009
    Messages:
    87
    Likes Received:
    0
    Yeah! I also heard the same news that most of the people want to stay with their 2.x OS. But is there any similar Messaging framework for 2.x? or should I look for some third party stuffs?

    -John
  8. bddckr

    bddckr Active Member

    Joined:
    Dec 2, 2007
    Messages:
    1,434
    Likes Received:
    18
    Device:
    iPhone 4 (Black)
    This seems like a good way to go with that email stuff...
  9. bones237

    bones237 New Member

    Joined:
    Feb 17, 2008
    Messages:
    101
    Likes Received:
    7
    Device:
    iPhone 3G (White)
    I could be mistaken but that issue will happen with the MessageUI Framework as well.
    I experienced something similar and from my testing it happens either way (using MessageUI on 3.0 or mailto on 2.x).
    I think its a problem with the OS.

    If you start an email then just hit the home button to exit the mail client then, yes, next email you start will get appended to that previous one you started.

    Try it this way....start an email but then hit cancel to discard the email instead of just hitting home button. Then when you start another email from within your app, it won't get appended to the previous. It will be a fresh new email.

    ......just what i experienced

Share This Page