0
我有一個適用於Android和iOS的應用程序。
我想填寫表格並將其發送到電子郵件地址。
基本上,這是得到一些反饋。unity 3D - 如何填寫表單並將其發送到電子郵件地址
但首先,這可能嗎?
非常感謝。
我有一個適用於Android和iOS的應用程序。
我想填寫表格並將其發送到電子郵件地址。
基本上,這是得到一些反饋。unity 3D - 如何填寫表單並將其發送到電子郵件地址
但首先,這可能嗎?
非常感謝。
假設你正在使用C#,是的,這是可能的。
This SO question可能會幫助你。 One of the answers claim to have a working code如下:
我只是用下面的代碼成功發送電子郵件從Unity 3D:
using System.Net;
using System.Net.Mail;
using UnityEngine;
public class SendMail : MonoBehaviour {
public string sender = "[email protected]";
public string receiver = "[email protected]";
public string smtpPassword = "mysmtppassword";
public string smtpHost = "mail.mymailacount.com";
// Use this for initialization
private void Start() {
using (var mail = new MailMessage {
From = new MailAddress(sender),
Subject = "test subject",
Body = "Hello there!"
}) {
mail.To.Add(receiver);
var smtpServer = new SmtpClient(smtpHost) {
Port = 25,
Credentials = (ICredentialsByHost)new NetworkCredential(sender, smtpPassword)
};
ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };
smtpServer.Send(mail);
}
}
}