Click here to Skip to main content
15,898,134 members

Not Receiving Mail in ios

SanjeevJayaram asked:

Open original thread
This is code. Code exectues properly but i am not receiving mail in inbox...

#import
i have also set MFMailComposeViewControllerDelegate in interface

- (IBAction)SendMailButton:(id)sender
{

if ([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];

mailer.mailComposeDelegate = self;

[mailer setSubject:[NSString stringWithFormat:@"Ordered Products & Person Details"]];

NSArray *toRecipients = [NSArray arrayWithObjects:@"p41sanjeev@gmail.com", nil];
[mailer setToRecipients:toRecipients];


NSString *emailBody =[NSString stringWithFormat:@"Product Ordered\n Product Name & Quantity :%@ \n Contact Person :\n %@ \n Mobile Number 1 :\n %@ \n Mobile Number 2 :\n %@ \n Address : %@ \n Email : %@",[globaldict orderedproduct],name.text,mobileno.text,mobileno1.text,address.text,email.text];
[mailer setMessageBody:emailBody isHTML:NO];

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


}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Failure"
message:@"Your device doesn't support the composer sheet"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[alert show];


}
}

- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
switch (result)
{
case MFMailComposeResultCancelled:
NSLog(@"Mail cancelled: you cancelled the operation and no email message was queued");
break;
case MFMailComposeResultSaved:
NSLog(@"Mail saved: you saved the email message in the Drafts folder");
break;
case MFMailComposeResultSent:
NSLog(@"Mail send: the email message is queued in the outbox. It is ready to send the next time the user connects to email");
break;
case MFMailComposeResultFailed:
NSLog(@"Mail failed: the email message was nog saved or queued, possibly due to an error");
break;
default:
NSLog(@"Mail not sent");
break;
}

[self dismissViewControllerAnimated:YES completion:nil];

}

what is the problem...
Tags: C (Objective C), Mobile Apps (iPhone, iOS)

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900