how to make sure email sent - iphone

I used MFMailComposeViewController to send email.
It always add the email to email queue.
If my email has large attached file, it will take a long time to send out.
Is there a way to make sure email has been sent?
Welcome any comment

Sadly, no, there is no way to make sure the email has actually been sent.
The best you can do is in mailComposeController:didFinishWithResult:error: in your MFMailComposeViewControllerDelegate check the result is equal to MFMailComposeResultSent, and this will tell you the email is queued to be sent.

Related

Only receiving one email from SMTP per account?

I've been playing around with SMTP, but I'm noticing an unfortunate pattern with the mail I send. I'm able to send an email once, and then when I send it again, it says it was successful, but I don't receive the email.
So I tried sending it to a different account. This account gets the email. I send another email. It's also "successful", but I don't get a second email on this account.
If I wait awhile, I can send another email to the account. But if I send the same message again a minute later, it won't show.
I think gmail is trying to protect me from "spam", but it makes testing very difficult. Is there a way I can get around this?
You are right, it's probably Gmail that "protects" you. I would suggest using a different email for testing.
Depending on the nature of yourbtests, you could also try to view the email in the browser.

How to prevent the acidentally mail sending in my app?

Too many times i receive mails with no content or with just "Sent from my iPhone". Those mails are sent from the "contact" section in my app.
After a little bit, it became boring.
So, is there any way to prevent the accidentally mail sending? I'm tired to see blank emails!
Don't think one can do much about the empty mails. (Maybe I haven't received so many yet that it troubles me ;) )
On the there hand the benefit of receiving user mail with a contents outweighs the boring empty mails. So I would just put up with the empty mails and maybe create a filter in the email client.
You could use the addresses for a newsletter with info about your app (with an out-out of course)
As you can not send mail through phones mailApp without user pressing the send button you also can't stop it from sending mail. If it really really bothers you you'll have to encode your own SMTP protocol and start sending mail directly from your code. But is it really worth it?
Or you can make user to type the text into a form (textbox) before calling mail-app. If he wrote something you pass it to mail-app and then he must go trough 'send procedure'

How to send BCC via MFMailComposeViewController in iPhone SDK?

One part of my app sends an e-mail with an attachment. I'm using the MFMailComposeViewController class, and all is well.
I just would like to know if I can send a stealth BCC message to myself, just for statistics purposes to keep track of how many messages have been sent.
Thank you!
UPDATE: the user tc didn't understand what I was trying to accomplish. I DON'T WANT TO INVADE USER'S PRIVACY. I just need to keep track of EVENTS ON MY APP. I didn't make myself clear on what I needed.
How about the setBccRecipients: method on your instance of MFMailComposeViewController?
Depending on the content of the e-mail message being composed, you might want to re-think sending a Bcc to yourself, unbeknownst to your users... Just sayin'...
You can track if an email was sent successfully without sending yourself a bcc of the message. Check the didFinishWithResult delegate method.

How to insure MFMailComposeViewController doesnt send email when body is not empty?

I have MFMailComposeViewController in my app in order to allow the user easily email me about suggestions and feedback on the app but I get about 3 emails a day which are just empty in the body or just the users email signature.
Is there any way of checking if the body of an email is not empty before it is sent with MFMailComposeViewController?
This is not a programming answer, and might be a bit off topic, but I have released a few apps with similar functionality, and have seen the same thing.
I have also talked with a few of the users who have sent in empty emails, and have learned that sometimes they sere just trying out the various functions of the App, and sometimes they get to the feedback page, but don't want to take the time to type out an email on their phone.
I would think of this as more of a customer service problem, and less of a programming challenge. I would use the opportunity to follow up with the users who send the empty emails. (At least now you have their email - if you don't let them send the form without a body you will likely never get it.) One option is to send a standard follow-up email that says you received an empty email from them and would love to hear their feedback on your product. (Perhaps even send them a quick survey) .
Once you have displayed the MFMailComposeViewController's view you cannot get at the message or control the behaviour. You cannot stop people sending empty mails.
If you really want to do this you will have to write a replacement view and controller. It is probably easier to filter the blank mails at the receiving end though :-)

How should the SENDER header be used in Emails

I've got a web app which I'm sending emails from. I want the emails to appear to come from users of the system, but guessing that these will appear as spoofed emails as they aren't coming from where they are saying they come from.
I've looked around and it appears that the SENDER header fits the bill. Is this a good solution? Also which way round should it be used? SENDER is the users email? or SENDER is the an email address from the domain I'm sending from?
Thanks in advance
Dave
Who is doing the sending of the emails? From your description I would guess that some action of a user triggers sending an email. In that case, the user's email address belongs in the From header, and in any case, an email address for your web app should be in the Sender header because that is doing the actual sending of the email.
Of course, this is how it ideally works. I have encountered broken email programs that actually use the Sender header for replies if that is present instead of From, so if the receivers of the emails start replying to you, you will probably need to reconsider, but for now go with the "correct" approach.