ios程序内发送邮件的代码
生活随笔
收集整理的這篇文章主要介紹了
ios程序内发送邮件的代码
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
如下內容是關于ios程序內發送郵件的內容。 iPhone API已經提供了系統寫郵件界面的接口,使用MFMailComposeViewController,用來顯示界面.
項目中需要添加MessageUi.framework。頭文件加入MFMailComposeViewControllerDelegate。#import <MessageUI/MessageUI.h>
sendMailViewController.m文件的實現:
- (void)viewDidLoad
{
button.frame = CGRectMake(0, 40, 320, 50);
[button setTitle: @"Mail" forState: UIControlStateNormal];
[button addTarget: self action: @selector(sendEMail) forControlEvents: UIControlEventTouchUpInside];
[self.view addSubview: button];
}
{
message:msg
delegate:nil
cancelButtonTitle:@"確定"
otherButtonTitles:nil];
[alert show];
[alert release];
}
-(void)sendEMail
{
Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
}
-(void)displayComposerSheet
{
}
-(void)launchMailAppOnDevice
{
}
{
}
總結
以上是生活随笔為你收集整理的ios程序内发送邮件的代码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: nat123软件windows版
- 下一篇: 资深专家都知道的顶级 Docker 命令