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 01-01-2011, 06:30 PM   #1 (permalink)
Indie Developer
 
iSDK's Avatar
 
Join Date: Jul 2010
Posts: 1,346
iSDK is on a distinguished road
Send a message via AIM to iSDK
Default MFMailComposer Send Email Without Presenting the View

Hi,

I have seen a few apps do this know, and I would like to know how. Basically in the app you are asked who you would like to send the email to, and then you would press send, and it will have sent the email without even showing the MFMailComposerViewController.

Please could you tell me how to do this.

Thanks

iSDK
iSDK is offline   Reply With Quote
Old 01-01-2011, 06:41 PM   #2 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

They are probably doing it without the built-in Mail app, most likely using their own email server.
baja_yu is offline   Reply With Quote
Old 01-01-2011, 09:44 PM   #3 (permalink)
iOS Programming God Mode
 
iOS IDDQD's Avatar
 
Join Date: Jan 2011
Location: Kansas
Posts: 29
iOS IDDQD is on a distinguished road
Default

Yes, they are most definitely creating their own SMTP backend. Why would you need something nefarious like this? Are you creating the next conficker spam botnet for iPhone?

OT: I'm sure there are services available in URL form, that you can use to create a specially crafted web address that will send an email. It probably would need to be done over a NSURLConnection.

Just curious

Last edited by iOS IDDQD; 01-01-2011 at 09:46 PM.
iOS IDDQD is offline   Reply With Quote
Old 01-01-2011, 09:53 PM   #4 (permalink)
Indie Developer
 
iSDK's Avatar
 
Join Date: Jul 2010
Posts: 1,346
iSDK is on a distinguished road
Send a message via AIM to iSDK
Default

No definitely not! I just wondered how they did it. Its a hassle less way of sending email.

Quote:
Originally Posted by iOS IDDQD View Post
Yes, they are most definitely creating their own SMTP backend. Why would you need something nefarious like this? Are you creating the next conficker spam botnet for iPhone?

OT: I'm sure there are services available in URL form, that you can use to create a specially crafted web address that will send an email. It probably would need to be done over a NSURLConnection.

Just curious
iSDK is offline   Reply With Quote
Old 01-01-2011, 10:04 PM   #5 (permalink)
iOS Programming God Mode
 
iOS IDDQD's Avatar
 
Join Date: Jan 2011
Location: Kansas
Posts: 29
iOS IDDQD is on a distinguished road
Default

The messageUI framework has setters for the To:, Subject: and Body: lines of the email window. You're looking at two user taps, max, to send an email with it. One tap for the user to bring up the modal window, and one tap to send/cancel. Any user who would rather just tap once I would say is truly lazy =)
iOS IDDQD is offline   Reply With Quote
Old 01-01-2011, 10:11 PM   #6 (permalink)
Indie Developer
 
iSDK's Avatar
 
Join Date: Jul 2010
Posts: 1,346
iSDK is on a distinguished road
Send a message via AIM to iSDK
Default

lol, your app does need to be 'lazy' compatible too!

Quote:
Originally Posted by iOS IDDQD View Post
The messageUI framework has setters for the To:, Subject: and Body: lines of the email window. You're looking at two user taps, max, to send an email with it. One tap for the user to bring up the modal window, and one tap to send/cancel. Any user who would rather just tap once I would say is truly lazy =)
iSDK is offline   Reply With Quote
Old 01-01-2011, 10:15 PM   #7 (permalink)
iOS Programming God Mode
 
iOS IDDQD's Avatar
 
Join Date: Jan 2011
Location: Kansas
Posts: 29
iOS IDDQD is on a distinguished road
Default

Tru dat. I created a custom feedback form class. Many users who want support or want to give feedback don't know certain things like what version of the operating system they are on or if they actually have the latest version of the app. If you're interested in it send me a PM so I'm not considered spamming the board.
__________________
iOS IDDQD: God mode for iOS Development!
Father of Kill Stats XD, the premiere stat keeping application for iOS, tracking all of your fps games. Kill Stats XD on the App Store
iOS IDDQD is offline   Reply With Quote
Old 01-04-2011, 07:27 AM   #8 (permalink)
Registered Member
 
Join Date: Dec 2010
Posts: 3
ObjectiveCoders is on a distinguished road
Default How to Mail Composer

Great article on how to use the mail composer:
Mail Composer | iOS Tips and Tricks
ObjectiveCoders is offline   Reply With Quote
Old 01-04-2011, 07:43 AM   #9 (permalink)
Indie Developer
 
iSDK's Avatar
 
Join Date: Jul 2010
Posts: 1,346
iSDK is on a distinguished road
Send a message via AIM to iSDK
Default

Nice site, Correct me if I am wrong but you do not need to implement the code in bold as apple will show their own alert if the mailcomposer cannot send mail. Test out the MessageComposer on an iPod Touch, and you will see exactly what I mean.

Code:
if ([MFMailComposeViewController canSendMail]) {
 
}else {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Status:" message:@"Your phone is not currently configured to send mail." delegate:nil cancelButtonTitle:@"ok" otherButtonTitles:nil];
 
    [alert show];
    [alert release];
}
Quote:
Originally Posted by ObjectiveCoders View Post
Great article on how to use the mail composer:
Mail Composer | iOS Tips and Tricks
iSDK is offline   Reply With Quote
Old 01-04-2011, 10:50 AM   #10 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

The documentation says

Quote:
canSendMail

You should call this method before attempting to display the mail composition interface. If it returns NO, you must not display the mail composition interface.
So I'd stick with that.
baja_yu is offline   Reply With Quote
Old 01-25-2011, 05:07 AM   #11 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 1
TheBlackPearl is on a distinguished road
Question MFMailComposer view does not suit with the color theme of my app!

dear all,

Has anyone got a solution on how we can send mail without presenting the MFMailComposerView?

OR

Is there any way I can add a background image on the MFMailComposerView?

I tried changing the backgroud color. it doesn't work.
Only thing i could do was change the navigationBar Tint color

Code:
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
picker.navigationBar.tintColor=[UIColor blackColor];
picker.view.backgroundColor=[UIColor brownColor];
Thanks in advance!
TheBlackPearl is offline   Reply With Quote
Old 02-08-2012, 09:05 AM   #12 (permalink)
Registered Member
 
Join Date: Jul 2011
Location: Oklahoma City, OK
Posts: 12
okc.engineer is on a distinguished road
Default

Quote:
Originally Posted by iOS IDDQD View Post
The messageUI framework has setters for the To:, Subject: and Body: lines of the email window. You're looking at two user taps, max, to send an email with it. One tap for the user to bring up the modal window, and one tap to send/cancel. Any user who would rather just tap once I would say is truly lazy =)
I would like to respond to this, because this is an issue I am facing in my enterprise app. It's not for laziness that this method would be useful; it's so the data presented in the email can't be altered. The method by which the system allows composing and sending emails also allows editing the email. In some cases, with our app, the data's integrity is paramount. To place it at risk of being altered -- either accidentally or on purpose -- is a threat to that integrity.

For example, the information collected in my app is formatted into an email and sent to a server which automatically processes the data. There are some users who don't understand that the processing is done entirely automatically, that no one ever sees the email itself unless it is kicked out for an error. Users have a tendency to place notations or instructions in the body of the text, or may change the subject field to something different, believing that someone will see it and respond to it. It not only doesn't work that way, but if the change affects the way the info is formatted, then the email is kicked out.

There is also the problem of falsifying information intentionally, which is rare, but does happen.

So you see, there are more important considerations for this method than just convenience. I would still like to find a way to skip presenting the email composer and simply send the information directly.
okc.engineer 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: 360
7 members and 353 guests
blueorb, fredidf, iAppDeveloper, iGamesDev, mottdog, sacha1996, Touchmint
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,667
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, host number one
Powered by vBadvanced CMPS v3.1.0

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