objective c - Xcode 4 / iOS - Send an email using SMTP from inside my app -


i've been looking around framework allow me send email inside app. have tried mailcore, pantomime , skpsmtp no luck. can't them compile in xcode, presumed outdated. there way can this? if so, how? thanks.

you can send emails ios device. no need implement smtp , all. best thing using inbuilt emailing facilities in ios gives access address book! auto-completes names, email addresses. yaaiiii!!

include, addressbook,addressbookui , messageui frameworks , code this. note can choose send content html too!

#import <messageui/messageui.h> #import <addressbook/addressbook.h> #import <addressbookui/addressbookui.h>  mfmailcomposeviewcontroller *mailcomposer;  mailcomposer  = [[mfmailcomposeviewcontroller alloc] init]; mailcomposer.mailcomposedelegate = self; [mailcomposer setmodalpresentationstyle:uimodalpresentationformsheet]; [mailcomposer setsubject:@"your custom subject"]; [mailcomposer setmessagebody:@"your custom body content" ishtml:no]; [self presentmodalviewcontroller:mailcomposer animated:yes]; [mailcomposer release]; 

for sake of completeness, have write selector dismiss email window if user presses cancel or send -

- (void)mailcomposecontroller:(mfmailcomposeviewcontroller*)controller            didfinishwithresult:(mfmailcomposeresult)result                         error:(nserror*)error  {      if(error) nslog(@"error - mailcomposecontroller: %@", [error localizeddescription]);     [self dismissmodalviewcontrolleranimated:yes];     return; } 

happy coding...


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -