messageUIFramework를 통해 MFMailComposeViewController에서 작업했습니다. 나는 자기에게 이메일을 보내야 만하는 경우가있다. 어떻게 "보낸 사람"주소 MFMailComposeViewController 대리인을 추가합니까? 어떤 제안?iOS를 사용하여 본인에게 전자 메일 보내기.
2
A
답변
7
APP에 이메일 보내는 방법은 무엇입니까?
- (IBAction)sendMail:(id)sender {
if ([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *mailer = [[MFMailComposeViewController alloc] init];
mailer.mailComposeDelegate = self;
[mailer setSubject:@"Message Pro"];
//Destination adress
NSArray *toRecipients = [NSArray arrayWithObjects:@"your adress", nil];
[mailer setToRecipients:toRecipients];
//Attachement Object
UIImage *myImage = [UIImage imageNamed:@"image.jpeg"];
NSData *imageData = UIImagePNGRepresentation(myImage);
[mailer addAttachmentData:imageData mimeType:@"image/png" fileName:@"mobiletutsImage"];
//Message Body
NSString *emailBody = @"message body";
[mailer setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:mailer animated:YES];
[mailer release];
}
else
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Failure"
message:@"Your device doesn't support the composer sheet"
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[alert show];
[alert release];
}
}
-(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.");
break;
case MFMailComposeResultFailed:
NSLog(@"Mail failed: the email message was not saved or queued, possibly due to an error.");
break;
default:
NSLog(@"Mail not sent.");
break;
}
// Remove the mail view
[self dismissModalViewControllerAnimated:YES];
}
은 .H 파일에 MessageUI.framework에게
IBAction
= 센드 메일- 를 잊었하지 마십시오
MFMailComposeViewControllerDelegate
0
"보낸 사람"주소는 MFMailComposeViewController
에 의해 지정되며 사용자는 메일 작성보기를 볼 때 구성된 메일 계정으로 대체 할 수 있습니다. 프로그래머는 "보낸 사람"주소를 가져 오거나 설정하는 것에 대해 걱정할 필요가 없습니다.
관련 문제
- 1. codeigniter를 사용하여 전자 메일 보내기
- 2. MFMailComposeViewController를 사용하여 전자 메일 보내기
- 3. 서블릿을 사용하여 전자 메일 보내기
- 4. OAuth를 사용하여 전자 메일 보내기
- 5. Javamail을 사용하여 전자 메일 보내기
- 6. RMAIL을 사용하여 전자 메일 보내기
- 7. Wordpress를 사용하여 전자 메일 보내기
- 8. Outlook을 사용하여 전자 메일 보내기
- 9. asp.net을 사용하여 전자 메일 보내기
- 10. 전자 메일 보내기 automaticlly
- 11. Pylons에서 전자 메일 보내기
- 12. 엄청난 전자 메일 보내기
- 13. 전자 메일 클라이언트 호환 전자 메일 보내기
- 14. 여러 전자 메일 보내기
- 15. 비동기 전자 메일 보내기
- 16. PHP로 전자 메일 보내기
- 17. 비동기 전자 메일 보내기
- 18. 자동으로 전자 메일 보내기
- 19. UITextfield에서 전자 메일 보내기
- 20. 투표 전자 메일 보내기
- 21. DB에서 전자 메일 보내기
- 22. Android에서 전자 메일 보내기
- 23. MessageUI없이 전자 메일 보내기
- 24. ColdFusion에서 전자 메일 보내기
- 25. HTML 전자 메일 보내기
- 26. DNN에서 전자 메일 보내기
- 27. 클라이언트에서 전자 메일 보내기
- 28. BlueHost에서 전자 메일 보내기
- 29. 전자 메일 보내기 (Java)
- 30. 전자 메일 보내기