ios程序内发送邮件的代码
生活随笔
收集整理的這篇文章主要介紹了
ios程序内发送邮件的代码
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
如下內(nèi)容是關(guān)于ios程序內(nèi)發(fā)送郵件的內(nèi)容。 iPhone API已經(jīng)提供了系統(tǒng)寫郵件界面的接口,使用MFMailComposeViewController,用來顯示界面.
項(xiàng)目中需要添加MessageUi.framework。頭文件加入MFMailComposeViewControllerDelegate。#import <MessageUI/MessageUI.h>
sendMailViewController.m文件的實(shí)現(xiàn):
- (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
{
}
{
}
總結(jié)
以上是生活随笔為你收集整理的ios程序内发送邮件的代码的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: nat123软件windows版
- 下一篇: 资深专家都知道的顶级 Docker 命令