开发者

Send mail through code without opening MailComposer or new view

开发者 https://www.devze.com 2023-03-20 07:41 出处:网络
In my application i want to send mail to some one. If i use 开发者_运维问答following code new window for gets opened for mail.

In my application i want to send mail to some one.

If i use 开发者_运维问答following code new window for gets opened for mail.

[[UIApplication sharedApplication] openURL: [NSURL URLWithString:string]];

And if i use MailComposer then same controller will shown for mail.

But i want to send mail direct from my code by opening any screen or view in my application, with the help of mail address, subject and body part.

Any help ?


download the sample code from skpsmtpmessage - Google Code and ran that. You might require to change few things but it will work.


Hoping not to sound too advertise-y, but you can easily do this with PostageApp.

All you have to do is make an API call with your API Key, the content of your email (or a template name) and make an HTTP POST request to our API server, and ta daaaa, it sends through. We currently have a few iPhone apps doing this very thing.

As an act of fairness, you can take a look at all of the services available for such an activity and you can choose which suits your needs:

  • PostageApp
  • SendGrid
  • PostmarkApp
  • Amazon SES

(Full Disclosure: I am the Product Manager of PostageApp.)

0

精彩评论

暂无评论...
验证码 换一张
取 消