IOS:发送邮件没有iphone / ipad邮件应用程序 [英] IOS: send a mail without iphone/ipad mail app

查看:177
本文介绍了IOS:发送邮件没有iphone / ipad邮件应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个具有5个文本框和一个textView的应用程序:

  1  - 名称
2 - 姓氏
3 - 电话
4 - 您的电子邮件(用户电子邮件,不是地址电子邮件接收者)
5 - 城市
6 - textView(用于身体邮件)

所以,当我填充所有的textView时,我想通过代码中设置的地址邮件发送此消息。 / p>

我将撰写邮件作为这个例子:

 邮件来自: namesurmane
email:yuor email
电话:电话
城市:city
bosy:textview content

但这不是我的问题;我的问题是我不想使用应用程序邮件iphone,但我想要我按一个按钮发送,我想显示一个alertView,说发送电子邮件,是可能吗?

解决方案

这应该工作

  MFMailComposeViewController * mailSendingController = [MFMailComposeVi ewController new]; 

[mailSendingController setSubject:@Feedback];
[mailSendingController setToRecipients:[NSArray arrayWithObject:@feedback@us.com]];
[mailSendingController setMessageBody:myText isHTML:NO];

mailSendingController.mailComposeDelegate = self;

[self presentModalViewController:mailSendingController animated:YES];

其中myText是您使用信息制作的字符串


I want to create an app that have 5 textfield and a textView:

1 - Name
2 - Surname
3 - Telephone
4 - "your email" (user email, not address email receiver)
5 - city
6 - textView (for body mail)

So, when I filled all textView I want to send this message at an address mail that is set in the code.

I'll compose mail as this example:

mail from: "name" "surmane"
email: "yuor email"
telephone: "telephone"
city: "city"
bosy: "textview content""

But it's not my problem; my problem is that I don't want to use app mail iphone, but I want that when I push a button "send", I want to show just an alertView that say "email sent"; is it possible ?

解决方案

This should work

MFMailComposeViewController *mailSendingController = [MFMailComposeViewController new];

[mailSendingController setSubject:@"Feedback"];
[mailSendingController setToRecipients:[NSArray arrayWithObject:@"feedback@us.com"]];
[mailSendingController setMessageBody:myText isHTML:NO];

mailSendingController.mailComposeDelegate = self;

[self presentModalViewController:mailSendingController animated:YES];

where myText is a string that you make with your info

这篇关于IOS:发送邮件没有iphone / ipad邮件应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆