views:

12

answers:

0

Hi all,

In my app i am recording audio. I want to mail the recorded audio file. I am doing like this.

MFMailComposeViewController *controller = [[MFMailComposeViewControlleralloc] init]; controller.mailComposeDelegate =self ;

NSData *myData = [NSData dataWithContentsOfURL:url];

Here url is the path.

printf("\n mydata %d",[myData length]);

When i am printing the data length i am able to get the length.

[controller addAttachmentData:myData mimeType:@"audio/caf" fileName:@"name"];

[self presentModalViewController:controller animated:YES];

After doing this file is attaching but when i am downloading it in my machine(Mac or windows) i am not able to play.

can any one please help me out.

Thank You