텍스트 필드와 이미지의 데이터가 포함 된 이메일을 보내려하는데 작동하지 않는 경우 알려주세요. 여기 내 코드는 다음과 같습니다.앱에서 이메일을 보내는 방법
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if(buttonIndex==1)
{
Cocktails*c=[[Cocktails alloc]init];
_arrTextField=[NSArray arrayWithObjects:_txtName,_txtIngredients,_txtPreper,_txtServe,_txtFrom ,nil];
NSLog(@"send email");
if ([MFMailComposeViewController canSendMail])
{
NSMutableArray*recipients=[[NSMutableArray alloc]init];
[recipients addObject:@"[email protected]"];
MFMailComposeViewController *controller= [[MFMailComposeViewController alloc]init];
controller.mailComposeDelegate= self;
[controller addAttachmentData:_imgDrink mimeType:@"image/png" fileName:@"Myimage"];
[controller setSubject:@"my cocktail"];
[controller setMessageBody: _arrTextField isHTML:NO];
[controller setToRecipients:recipients];
}
else
{
UIAlertView* alert=[[UIAlertView alloc]initWithTitle:@"Alert" message:@"Your devise is not set up for Email" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:Nil, nil];
[alert show];
// [alert release];
}
귀하의 솔루션이어야합니다! – MasterRazer
감사합니다,하지만 이메일 화면을보고 싶지 않습니다. 자동으로 보내고 싶습니다. – user1763326
오, 오케이 내 잘못을 찾아 보겠습니다. – MasterRazer