We need MessageUI framework to send email. Sending Email can not be tested using iPhone simulator. The reason is simulator does not include a mail app. The application should be installed in actual device and tested. In simulator, it displays a successful message that email has been sent but it just an indicator that no other problem with source code.
[sourcecode language="objc"]
NSData *audioFile = [[NSData alloc]initWithContentsOfURL:temporaryRecFile];
MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc]init];
mailer.mailComposeDelegate = self;
[mailer setSubject:@"Greeting Message"];
NSArray *toReceipients = [NSArray arrayWithObjects:@"recepient_mail_address", nil];
[mailer setToRecipients:toReceipients];
[mailer addAttachmentData:audioFile mimeType:@"audio/caf" fileName:@"VoiceFile.caf"];
[mailer setMessageBody:@"My greetings for you" isHTML:NO];
[self presentModalViewController:mailer animated:YES];
[mailer release];
}
else
{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Failure" message:@"Device does not support" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
[/sourcecode]
Subscribe to:
Post Comments (Atom)
How to enable CORS in Laravel 5
https://www.youtube.com/watch?v=PozYTvmgcVE 1. Add middleware php artisan make:middleware Cors return $next($request) ->header('Acces...
-
< Requirements Java Development Kit (JDK) NetBeans IDE Apache Axis 2 Apache Tomcat Server Main Topics Setup Development Environ...
-
Download Sourcecode [sourcecode language="csharp"] using System; using System.Collections.Generic; using System.Linq; using System...
No comments:
Post a Comment