iOS 之发送邮件的常用方法

S32K3XX MCU时钟配置避坑指南:从外部晶振到UART波特率的完整实战流程 本文详细解析了S32K3XX MCU时钟配置的关键要点,从外部晶振选择到UART波特率计算的完整流程。针对开发者常见的PLL配置错误、CAN模块时钟使能等痛点问题,提供实战解决方案和调试技巧,帮助避免时钟配置导致的通信异常和系统不稳定问题。 阅读详情
#pragma mark - email  
- (void)showMailPicker
{
    Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
    if (mailClass != nil) {
        if ([mailClass canSendMail]) {
            [self displayMailComposerSheet];
        }else{
            [self launchMailAppOnDevice];
        }
    }else{
        [self launchMailAppOnDevice];
    }
}
- (void)displayMailComposerSheet
{
    MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
    picker.mailComposeDelegate = self;
    
    [self presentModalViewController:picker animated:YES];
    [picker release];
}
-(void)launchMailAppOnDevice
{
    NSString *recipients = @"mailto:first@example.com?cc=second@example.com,third@example.com&subject=my email!";
    //@"mailto:support@shichangit.com?subject=意见与反馈"
    NSString *body = @"&body=";

NSString *email = [NSString stringWithFormat:@"%@%@", recipients, body];
email = [email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]];
}
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
    NSString *msg;
    
    switch (result)
    {
        case MFMailComposeResultCancelled:
            msg = @"邮件发送取消";
            break;
        case MFMailComposeResultSaved:
            msg = @"邮件保存成功";
            [self alertWithTitle:nil msg:msg];
            break;
        case MFMailComposeResultSent:
            msg = @"邮件发送成功";
            [self alertWithTitle:nil msg:msg];
            break;
        case MFMailComposeResultFailed:
            msg = @"邮件发送失败";
            [self alertWithTitle:nil msg:msg];
            break;
        default:
            break;
    }
    [self dismissModalViewControllerAnimated:YES];
}
- (void)alertWithTitle:(NSString *)title msg:(NSString *)message
{
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title
                                                    message:message
                                                   delegate:nil
                                          cancelButtonTitle:@"确定"
                                          otherButtonTitles:nil];
    [alert show];
    [alert release];
}
iOS开发——发送邮件 iOS开发中,要实现应用发送邮件的功能有多种方法。本文中介绍的邮件发送功能是由MessageUI Framework提供的,这个框架是iPhone SDK中最简单的框架。由一个类、一个视图控制器,一个protocol组成。 为了直观地演示,我们通过一个Step by  Step的Demo来阐述下这个方法的基本使用技巧。 首先,创建一个Single View的示例项目。这里,我创建了一个名为Ma 阅读详情

相关推荐

别再只用真彩色了!手把手教你用ENVI主成分分析(PCA)给遥感图像‘美颜’与‘瘦身’

本文详细介绍了如何利用ENVI主成分分析(PCA)技术优化遥感图像处理,实现数据‘美颜’与‘瘦身’。通过PCA的维度压缩、噪声分离和特征增强三大优势,显著提升高光谱数据的可视化效果和分析效率。文章还提供了ENVI操作的最佳实践和常见问题解决方案,帮助读者掌握这一遥感图像处理的游戏规则改变者。

weixin_28465009的博客 275

(python)发邮件

在互联网时代,我们经常需要发送电子邮件来沟通信息。如果你是一个编程爱好者或者开发者,可能会遇到需要通过程序自动发送邮件的场景。

MARST.ZHANG的博客 655

游戏资源解包神器NSCB实战:手把手教你提取Switch游戏视频(nsm转MP4)

本文详细介绍了如何使用NSCB工具链从Switch游戏中提取nsm视频和hca音频资源,并将其转换为可编辑的MP4和MP3格式。通过NSC Builder、CriPakTools等工具的分步操作指南,帮助内容创作者高效获取游戏资源,同时提供音视频同步合成、批量处理等高级技巧,为创意素材制作提供完整解决方案。

weixin_29197835的博客 887

Xcode 上的邮箱发送

1.建立一个工程,添加库

quanhaoH的专栏 1254

Win10系统安装Ubuntu虚拟机,这回真的是零基础!(结尾附NS3的配置)

Win10系统安装Ubuntu虚拟机(结尾附NS3的配置) 序幕 本人现在还在念大二,有一门很有趣而且老师讲得也不错的课程《计算机网络原理》。这周老师布置了一个实验《NS3网络模拟》,为了详细记录本次实验过程,顺便也便于自己复习,就写了这篇博客,希望能够对你有帮助! NS3是什么呢?实际上就是一门算法,和计算机网络有关的。不过在我们日常使用的Windows系统上去做这个实验是行不通的,这个实验一定要在Linux系统上进行模拟才能玩的下去,作为一名 Windows选手对此表示不爽但是没办法,为了实验也只

灼热之翼的博客 7382

串行通信原理及实验仿真

1. 处理器与外部设备通信的两种方式: 并行通信和串行通信 并行通信是指数据的各个位用多条数据线同时进行传输 优点:传输速度快 缺点:占用引脚资源多 串行通信是将数据分成一位一位的形式在一条传输线上逐个传输 优点:通信线路简单,占用引脚资源少 缺点:传输速度慢 2. 串行通信的通信方式: 同步通信和异步通信 同步通信:带有时钟同步信号的数据传输;发送方和接收方在同一时钟的控制下,同步传输数据。 异步通信:不同时钟同步信号的数据传输。发送方和接收方使用各自的时钟控制数据的发送和接收过程。 3. 串行通

gemengxia的博客 4322

发送邮件的几个函数

#pragma mark - email   - (void)showMailPicker {     Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));     if (mailClass != nil) {         if ([mailClass canSendMail]) {

lookyou111的专栏 596

用友BIP培训资料-设计采购订单新增API接口开发

14.在子实体的String pkMeas = order_hhrSlave0VOJson.getString("pk_meas");Openapi路径:nccloud/api/pu/order_hhrmanage/order_hhrMaster/addAggOrder_hhrMasterVO。实现接口的开发部署,通过openAPI的test类,实现一条数据的插入。16.进入自己的Idea打开老师发的TestOpenApi并且编译完成后如下。12.编写检测是否字段中是否含有中文的方法。

m0_68497879的博客 1542

mail函数发送邮件

调用的方法很简单: <?php $to = "myemail@163.com"; $subject = "Test mail"; $message = "Hello! This is a simple email message."; $headers = "From:dragon"; mail($to,$subject,$message,$headers); echo...

weixin_30654583的博客 390

嵌入式开发环境Vscode开发STM32单片机程序

STM32单片机非常强大,大多数教程都是使用 keil 编译器,keil 是收费的而 gcc 是开源免费的。这里介绍一些使用 gcc +开发单片机程序的经验。(这里不解释 gcc 是什么)。

嵌入式技术开发 1842

前端技能树,面试复习第 54 天—— 手写代码:情景题

前端修罗场提供全网最专业的前端优质文章与社区服务,为应届生,初中级前端工程师提供全面、优质的面试服务、技能提升、职场解惑服务!内容包含:前端面试辅导,前端面试题,前端交流,前端答疑,前端基础知识,前端知识体系,技能树搭建,Javascript,CSS,CSS3,HTML,React,Vue,小程序,前端简历,职业交流,远程工作,英文交流,英文提升,外企,互联网,国企,大厂,牛客面试题,掘金面试题,面经,优质前端文章分享...

前端进阶之路 | 中大厂、外企、国企内推 | 面试培训 | 简历修改 986

iOS 常用小功能

小功能简介 iOS中的很多小功能都是非常简单的,几行代码就搞定了,比如打电话、打开网址、发邮件、发短信等    打电话-方法3 创建一个UIWebView来加载URL,拨完后能自动回到原应用 if (_webView == nil) {     _webView = [[UIWebView alloc] initWithFrame:CGRectZero]; } [_

VIM的博客 294

qcc514x-qcc304x调试笔记

qcc514x-qcc304x调试笔记-1-QCC514x系列 qcc514x-qcc304x调试笔记-2-开发环境搭建 qcc514x-qcc304x调试笔记-3-如何修改蓝牙名称 qcc514x-qcc304x调试笔记-4-如何修改蓝牙地址 qcc514x-qcc304x调试笔记-5-如何区分左右耳 qcc514x-qcc304x调试笔记-6-PIO相关操作 ...

leezs的博客 1244

调用Iphone 邮件 电话 sms 浏览器

邮件[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://devprograms@apple.com"]];电话[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel://8004664411"]];sms[[UIApp

@implemention NSiOSBlog 930

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

2012 开源库 ios常用第三方库

转自:http://blog.youkuaiyun.com/yu0089/article/details/8026940 因为iOS SDK相对比较底层,所以开发者就得受累多做一些体力活。不过幸运的是,有很多第三方的类库可以用来简化很多不必要的工作。笔者整理了一下在本人学习过程中用到的一些比较有用Objective-C开源类库,既是做一个总结,同时也希望通过这些分享,能提高各位的开发效率。

caizhongtao的专栏 803

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

IOS应用

下面是这个类的一些功能: 1.设置icon上的数字图标 //设置主界面icon上的数字图标,在2.0中引进,缺省为0 [UIApplicationsharedApplication].applicationIconBadgeNumber= 4; 2.设置摇动手势的时候,是否支持redo,undo操作 //摇动手势,是否支持redo undo操...

weixin_30663471的博客 63

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

UIApplication sharedApplication总结

UIApplication sharedApplication 常用的一些方法总结! // openURL:方法的部分功能有 // 打电话 UIApplication *app = [UIApplication sharedApplication]; [app openURL:[NSURL URLWithString:@"tel://10086”]];// 发短信 [app openURL:[NSU

lwq859842444的博客 382

iphone在应用程序用调用系统功能

iPhone的单任务模式为手机节省了资源,保障了程序的安全运行,但是这一做法也遭到很多人的反对, 为很多应用带来了不便。如今,openURL这个方法为解决这一问题带来了希望,虽然离多任务模式还有差距,但毕竟给了大家一个实现更强大应用的可行方法。 openURL的使用方法: CODE: [[UIApplication sharedApplication] openURL:[NSU

code life 477

在一个应用程序中调用其他的应用,比如说网站,App Store等等

In an earlier post I talked about how to launch the browser from within an iPhone application using the UIApplication:openURL: method. It is also possible to use this same technique to launch oth...

johnie_sheng的专栏 221

IOS邮件发送的方法

IOS系统框架提供的两种发送Email的方法:openURL 和 MFMailComposeViewController。借助这两个方法,我们可以轻松的在应用里加入如用户反馈这类需要发送邮件的功能。   1.openURL 使用openURL调用系统邮箱客户端是我们在IOS3.0以下实现发邮件功能的主要手段。我们可以通过设置url里的相关参数来指定邮件的内容,不过其缺点很明显,这

COOL_BEAR_XX的专栏 1833

IOS开发中发送电子邮件的两种方法

IOS系统框架提供的两种发送电子邮件的方法:openURL和 1.openURL 使用openURL调用系统邮箱客户端是我们在IOS3.0以下实现发邮件功能的主要手段。我们可以通过设置url里的相关参数来指定邮件的内容,不过其缺点很明显,这样的过程会导致程序暂时退出。下面是使用openURL来发邮件的一个小例子: 的#pragma商标 - 使用系统的邮件客户端发送邮件  

无名的专栏 2283

IOS开发-发送邮件(E-mail)方法整理合集(共3种)

本文转载至http://www.cnblogs.com/GarveyCalvin/p/4184162.html 前言:在IOS开发中,有时候我们会需要用到邮件发送的功能。比如,接收用户反馈和程序崩溃通知等等。其实这个功能是很常用的,因为我目前就有发送邮件的开发需求,所以顺便整理下IOS发送邮件的方法。 IOS原生自带有两种方法发送邮件的方法,另一种是使用第三方库: ...

a1311010193的博客 3147

iOS 实现发送邮件和短信

发送邮件 #import

程序猿 3808

ios程序内发送邮件的代码

如下内容是关于ios程序内发送邮件的内容。 iPhone API已经提供了系统写邮件界面的接口,使用MFMailComposeViewController,用来显示界面. 项目中需要添加MessageUi.framework。头文件加入MFMailComposeViewControllerDelegate。#import <MessageUI/MessageUI.h> sendMail...

weixin_34244102的博客 499

ios发送邮件

本文转载至 http://www.cnblogs.com/edgarli/archive/2013/07/26/3216876.html 方法一: 1.需要引入库MessageUI.framework #import<MessageUI/MessageUI.h> #import<MessageUI/MFMailComposeViewContro...

a1311010193的博客 205

IOS发送带附件的邮件

1.加入邮箱的框架 #import #import 2.添加委托 @interface ViewController : UIViewController 3.实现代码 - (void)alertWithTitle:(NSString *)title msg:(NSString *)msg { if (title && msg) {

zltianhen的专栏 7365
上一篇: iOS 之日期/时间段转换
下一篇: iOS 之获取地图经纬度
Shicuf
博客等级 码龄16年 11粉丝 66原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值