Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 07-07-2010, 01:11 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 557
Joseph Nardone is on a distinguished road
Default sending mail from iPad

Hi:
Does anyone have functional code that can send email from iPad? I use the Apple MailComposer code in my iPhone apps but it will not work when I change the app to Universal.
Joseph
Joseph Nardone is offline   Reply With Quote
Old 07-07-2010, 01:23 PM   #2 (permalink)
Super Moderator
 
Join Date: Oct 2009
Location: San Diego, CA
Posts: 1,586
JasonR is on a distinguished road
Default

I can't check my iPad app until tonight, but I don't remember having to make any big changes when I ported the MailCompose code to the iPad. It should just work.
JasonR is offline   Reply With Quote
Old 07-07-2010, 01:26 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 557
Joseph Nardone is on a distinguished road
Default

Quote:
Originally Posted by JasonR View Post
I can't check my iPad app until tonight, but I don't remember having to make any big changes when I ported the MailCompose code to the iPad. It should just work.
Thanks, I would appreciate it greatly. I even downloaded the latest copy of the MailComposer sample app and converted it to a universal and it won't work on iPad (device or simulator) after the conversion. It still works on iPhone.
Joseph Nardone is offline   Reply With Quote
Old 07-07-2010, 01:27 PM   #4 (permalink)
Super Moderator
 
Join Date: Oct 2009
Location: San Diego, CA
Posts: 1,586
JasonR is on a distinguished road
Default

If you can explain what you mean by "won't work", I might be able to help sooner.
JasonR is offline   Reply With Quote
Old 07-07-2010, 02:00 PM   #5 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 557
Joseph Nardone is on a distinguished road
Default

Sure:

I downloaded the MailComposer sample app. Selected it in "Target" then under Project clicked to "upgrade to iPad" and then chose "universal" when the window popped up.

Next, I changed the deployment target device to iPhone/iPad.

I built the app, and it runs on the iPhone simulator and device - you click "compose" button and a email composer sheet appears with some information and an image already filled in.

If it is run on iPad simulator or device you get the first view with the compose button but when you press the button you get a blank view which is propably a composer sheet. It has no text or buttons. If you touch inside the view a keyboard pops up.

There are no errors or warnings in the compiler.

I am using base SDK 4.0 and have tried deployment target 3.0 and 3.2 with the same result.

If I don't "convert" the app to universal it will run fine as an iPhone app on iPad simulator or device.

Thanks,

Joseph
Joseph Nardone is offline   Reply With Quote
Old 07-07-2010, 03:10 PM   #6 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 557
Joseph Nardone is on a distinguished road
Default

Solved - Sort of

If I add:

picker.modalPresentationStyle = UIModalPresentationFullScreen;

to the displayComposerSheet method then I get a small (iphone size) but complete email composer sheet on all devices.

Joseph
Joseph Nardone is offline   Reply With Quote
Old 07-08-2010, 10:51 AM   #7 (permalink)
Super Moderator
 
Join Date: Oct 2009
Location: San Diego, CA
Posts: 1,586
JasonR is on a distinguished road
Default

I didn't have to do any of that. My iPad code is a simplified version of the sample you mentioned:

Code:
    MFMailComposeViewController *myMailView = [[MFMailComposeViewController alloc] init];
	[myMailView setMessageBody:[self makeCopyString] isHTML:NO];
	myMailView.mailComposeDelegate = self;
	[self presentModalViewController:myMailView animated:YES];
    [myMailView release];
I never had to mess with what you mentioned, and I get a full screen mail composer.
JasonR is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 330
9 members and 321 guests
bignoggins, Chickenrig, firecall, givensur, iNet, michaelhansen, Objective Zero, PlutoPrime, stanny
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,893
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:34 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0