1
MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init];

controller.mailComposeDelegate = self;

[controller setToRecipients:[NSArray arrayWithObject:@"sales@info.com"]];


[controller setSubject:@""];

[controller setMessageBody:self.messageText.text isHTML:NO];

[self presentViewController:controller animated:YES completion:nil];

Here I'm getting MFMailComposeViewController for sending mail, but I don't want use the MFMailComposeViewController while sending mail, directly send to receipent

message has already stored in "messageText.text" when click send button getting mvc

nbanic
  • 1,248
  • 1
  • 8
  • 11
raz
  • 67
  • 6
  • i want send mail, which message stored in textfield, dont want to use mfmailcomposer – raz Nov 09 '13 at 10:36

2 Answers2

2

You can't do this with MFMailComposeViewController. Apple is very specific in the docs that sending email is under the users control, not your apps. You are sending email from the users account, you can understand why access to the email is restricted In this way(Here Explained Well).

There is a ways to achive it via many Webservices .

There is a project on google code to send messages through SMTP : skpsmtpmessage

Take a look at here for the Tutorial

Community
  • 1
  • 1
Kumar KL
  • 15,086
  • 9
  • 36
  • 57
1

Take a look at this code snippet. You might require this framework: https://code.google.com/p/skpsmtpmessage/

Sebastian Łuczak
  • 1,084
  • 8
  • 17