2011-12-22 93 views
3

我想創建一個有5個文本框的應用程序和一個TextView:IOS:發送郵件,而iPhone/iPad的郵件應用程序

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

所以,當我填寫所有的TextView我想在發送這封郵件地址在代碼中設置的郵件。

我將撰寫郵件,因爲這例子:

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

但它不是我的問題;我的問題是我不想使用應用程序郵件iPhone,但我希望當我按下「發送」按鈕時,我只想顯示一個alertView,說「發送電子郵件」;可能嗎 ?

回答

2

的內置郵件法這應該工作

MFMailComposeViewController *mailSendingController = [MFMailComposeViewController new]; 

[mailSendingController setSubject:@"Feedback"]; 
[mailSendingController setToRecipients:[NSArray arrayWithObject:@"[email protected]"]]; 
[mailSendingController setMessageBody:myText isHTML:NO]; 

mailSendingController.mailComposeDelegate = self; 

[self presentModalViewController:mailSendingController animated:YES]; 

會將myText地方是一個字符串,你與你的信息

0

這可以通過將數據發送到服務器並從那裏發送來完成。我沒有看到直接從設備發送它的方式,而不使用郵件應用程序。

+0

好吧,我解決MFMailComposeViewController ... – CrazyDev 2011-12-22 10:32:19

+0

沒有老兄,你可以通過像hiren這樣的webservice來解決這個問題。例如通過POST向PHP服務器發送一些數據,並填入空格。 – MaikelS 2011-12-22 11:04:56

0

爲此,您必須創建webservice。因爲如果沒有這個唯一的選擇是IOS

相關問題