Using MFMailComposeViewController, is it possible to BCC the default mail account? - iphone

I believe that the iOS SDK provides no access to the details of the default mail account (for good reason), but is there any other way to somehow setup MFMailComposeViewController to prefill the BCC field with the "from" address?
Am I overlooking something obvious or is the only way for the user to fill in the BCC herself?

That information is not accessible via the public API.
Make them input their email on first launch? Perhaps search the Address Book for entries like "Me", or something similar?

-[MFMailComposeViewController setBccRecipients:]

There is no way for the app to do this itself. However, MFMailComposeViewController will pre-fill the BCC field with the FROM address if the user has turned on the Mail setting for "Always Bcc Myself".

Related

sendgrid/mail wont allow sending 'from' to be dynamically

I have a form on my portfolio that allows a user fill in a form with a question they have and send that to me by email.
When i try to use sendgrid it only allows me as a verified user to send emails from my own email address. but i want the 'from' field to be dynamically filled in by that user and then sent to me.
note: I also tried 'emailjs' but that works fine in development but fails in production.
Any suggestions on how to fix this or any other platforms i can use for that preferabally free since it is a hobby project.
Thanks
Twilio SendGrid developer evangelist here.
You do need to use a verified email address to send emails from SendGrid, this is to stop people using a form like you describe to spoof anyone's email address.
A better idea is to send emails created in your form from a verified email address and set the reply-to address as the submitted email. That way you can send with SendGrid and then when you reply in your email client it will return to the person that submitted the form.
I added more detail and example code (in Python) in this answer.

How to disable the TO address on compose email UI using MonoTouch?

I need to disable the TO address on compose mail UI. Because i used static email address. Also i don't want CC/Bcc address. How to remove CC/Bcc address on compose mail UI? I'm using MFMailComposeViewController for sending email.
I'm using MonoTouch. How to achieve this one?
You cannot do that, and there's a good reason.
Apple's approach to UI design is to make sure user is always in control.
If you present user with an email form, you should be prepared she might want to cancel and save it as a draft for later, add her other email address to CC, or even change To address if she really wants to.
The documentation for MFMailComposeViewController explicitly states:
The mail composition interface itself is not customizable and must not be modified by your application. In addition, after presenting the interface, your application is not allowed to make further changes to the email content.
To sum up, if you don't want user to be in control of target address, perhaps you should consider sending an email bypassing the MFMailComposeViewController UI.

email send from ipad without setup account

i want(i mean client :)) to send an email from a particular account.
in my app there is an option of sending a mail.
now i want to do as any one from any ipad sends email from using this app will sent by one particular account.
How can i do so?
Thanks,
Shyam
From this link
By looking at the class reference for MFMailComposeViewController in the documentation, I'd say you can't do anything about it. It's not very flexible unfortunately, same as sending SMS, and there you can't MMS with it, just SMS.
You can't specify a default email address. If you could, I suspect one could view this as a security risk for spam/unsolicited mail.
You can't using Apple's API, it will use the Mail app and whatever account is setup in there. You'll have to grab full sendmail client code and incorporate it into your app.

Sending anonymous email from MFMailComposeViewController

This may be a stupid question, but is there any possible way (from a developer's perspective) to send an email from the MFMailComposeViewController and also change the From: address from the default email account set up on the phone? I want to upload some data from my application, but I don't want it to be linked to the user's email address.
Even if you change the From: it does not accomplish any kind of anonymity. Any well-behaved mail server adds that info to your mail headers.

access default email address

I am using the MFMailComposeViewController in 3.0 to send an email with attachment etc. inside my app. I would like the "To:" address to be defaulted to the default account/address on the device. How can I access this address to place it into a string for the setToRecipients?
Essentially, I'm going to let the user send an email to themselves (as the default "To") with an attachment inside the app.
The API doesn't expose that information publicly (for probably good reasons, such as preventing developers from harvesting iPhone users' email addresses).
You should probably go about asking for the user's email address and then saving it for future use.
It appears that the accepted answer is wrong
Getting user's default email address in Cocoa
This answer shows the code for getting the e-mail address from the address book ( listed under 'me' )
EDIT: Note the comment! OSX only not iOS :|
You can use ABGetMe for iOS to get the user's address book card. Have a look at the source code, you will see how to retrieve all e-mail addresses for a given ABRecordRef.