PDA

View Full Version : using mail application in iphone App




ruhi
Aug 3, 2010, 12:53 PM
Hello,

I want to send mail from my iphone application with the help of Mail.app which is already there in iphone.

How can i do it?

Thanks ,
Ruhi



dejo
Aug 3, 2010, 01:09 PM
http://forums.macrumors.com/showthread.php?t=981077&highlight=email
http://forums.macrumors.com/showthread.php?t=937505&highlight=email
http://forums.macrumors.com/showthread.php?t=615610&highlight=email
http://forums.macrumors.com/showthread.php?t=914919&highlight=email
...

newtoiphonesdk
Aug 3, 2010, 01:40 PM
Create an IBAction called email in the .h of the View you would like to email from. Then in the .m put in the following code:

- (IBAction)email {

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://example@yahoo.com"]];

}
Then you can go in IB and create a Round Rect Button and connect the action to the button using Touch Up Inside.



How hard was it for me to type in that code instead of sending the person to links that don't helP? Not very hard at all.