0
A
回答
1
您應該使用MFMailComposeViewController
類,並實行MFMailComposeViewControllerDelegate
協議,
首先發送一個消息:
MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init];
controller.mailComposeDelegate = self;
[controller setSubject:@"My Subject"];
[controller setMessageBody:@"Hello there." isHTML:NO];
[self presentModalViewController:controller animated:YES];
[controller release];
一旦你發送你將得到代表回撥mailComposeController
:
- (void)mailComposeController:(MFMailComposeViewController*)controller
didFinishWithResult:(MFMailComposeResult)result
error:(NSError*)error;
{
if (result == MFMailComposeResultSent) {
NSLog(@"It's gone!");
}
[self dismissModalViewControllerAnimated:YES];
}
1
郵件中創建新的消息:
NSString *subject = @"The subject";
NSString *body = @"The message";
NSString *address = @"[email protected]";
NSString *cc = @"[email protected]";
NSString *path = [NSString stringWithFormat:@"mailto:%@?cc=%@&subject=%@&body=%@", address, cc, subject, body];
NSURL *url = [NSURL URLWithString:[path stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
[[UIApplication sharedApplication] openURL:url];
相關問題
- 1. 登錄雅虎郵箱編程
- 2. 編程雅虎郵箱導航
- 3. 郵箱登陸的郵箱
- 4. 從iPhone上的Exchange IMAP郵箱中刪除郵件
- 5. 有沒有辦法在我自己的iPhone應用程序中訪問iPhone郵件應用程序郵箱?
- 6. iPhone 4.0 =如何從IPhone收件箱編程方式
- 7. 多郵箱php郵箱
- 8. 獲取「遠程」郵箱的郵箱文件夾權限
- 9. AppleScript將郵件移動到郵箱中的規則郵箱
- 10. 如何在iPhone中以編程方式閱讀SMS收件箱?
- 11. 以編程方式打開iPhone的iPhone郵件客戶端
- 12. 獲取Gmail郵箱中的郵箱狀態不起作用
- 13. 交換 - 在郵箱大小的OU中列出郵箱
- 14. Gmail郵箱中的郵件訂單
- 15. F#郵箱vs郵箱處理器
- 16. 如何以編程方式檢測iphone中的傳入郵件?
- 17. 以編程方式驗證到達交換郵箱的電子郵件
- 18. iphone編程中的MemoryLeak?
- 19. iPhone中的藍牙編程
- 20. iPhone中的串口編程
- 21. iPhone中的tableViewController編程式
- 22. 的郵編,電話,電子郵箱和日期
- 23. 如何使用多個郵箱編程Outlook 2007加載項
- 24. 驗證郵箱是否存在於郵箱中
- 25. 在php中使用imap創建郵箱帳戶不是郵箱
- 26. 郵箱結構
- 27. Spring MVC郵箱
- 28. 郵箱驗證
- 29. 如何將pdf文件從郵箱轉移到我們的iphone應用程序?
- 30. 是否有遠程編程創建Exchange郵箱的權威指南?