-4

I want to send a mail with HTML-content when I click a UIButton.

How can I proceed ?

Thanks a lot

Rob
  • 15,732
  • 22
  • 69
  • 107
  • check this out http://stackoverflow.com/questions/740939/open-source-cocoa-cocoa-touch-pop3-smtp-library – Omar Abdelhafith Jun 11 '12 at 12:53
  • Duplicate of http://stackoverflow.com/questions/7087199/xcode-4-ios-send-an-email-using-smtp-from-inside-my-app – woz Jun 11 '12 at 12:54
  • 1
    In the future please do a quick Google and Stack Overflow search of your question. This has certainly been answered hundreds of times. – Ryan Poolos Jun 11 '12 at 12:56
  • Check the accepted answer in the following link, for a way to send emails in the background: http://stackoverflow.com/questions/6284599/mfmailcomposeviewcontroller-question-locking-the-fields – Luke Jun 11 '12 at 13:32

1 Answers1

3

If you want to give the user a chance to review it before sending it (which is generally recommended), see MFMailComposeViewController. For other implementations see the other links provided by others.

Rob
  • 415,655
  • 72
  • 787
  • 1,044
  • Thanks but I don't need it. In fact I'm developing an app allowing the user to look for jobs, and I suggest him if he wants to send it to other people by mail. That's why I don't want him to edit it. – Rob Jun 11 '12 at 12:59
  • Ok. Personally, I would have thought that this would have been precisely the sort of situation where someone would like to see the email before sending it and have a chance to review and to customize it. (Would you really like to apply for a job but not know how you've been represented to your prospective employer?!?) But, it's entirely up to you. I hope one of the other links helps you out! – Rob Jun 11 '12 at 13:04
  • how can we send email without MFMailComposer modelView? – Rajneesh071 Aug 22 '13 at 10:20
  • @Rajneesh071 See the links in the comments to the original answer, which point to articles how to do it without the `MFmailComposer`. They generally entail interfacing directly with a SMTP server. – Rob Aug 22 '13 at 14:16
  • @Rob in that answer i have to set smtp host, smtp.gmail.com, but i don't want to set it .. i just want to insert email and password , so that we can send mail in background.... – Rajneesh071 Aug 23 '13 at 05:24
  • @Rajneesh071 Alas, those are your are your two options, either (a) use `MFMailComposer`, live with the email confirmation UI but take advantage advantage of the built-in email configuration; or (b) interact with SMTP manually yourself. – Rob Aug 23 '13 at 06:16
  • how to do SMTP manually? – Rajneesh071 Aug 23 '13 at 07:27
  • @Rajneesh071 You do sockets calls via `CFNetwork` to connect to a SMTP server, and issue commands and interpret responses in accordance with the SMTP protocol. That's what those various classes referenced by those other links do, so it would be easier if you use one of those classes than you're trying to implement it yourself, manually. – Rob Aug 23 '13 at 13:28