Код
using UnityEngine;
using System;
using System.Collections;
using System.Net;
using System.Net.Mail;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
public class MailSender
{
public MailSender(string smtpServer, int port, string from, string fromName, string password, string username,
string mailto, string subject, string message, string calculator, string email)
{
SmtpClient _smtpServer = new SmtpClient(smtpServer);
MailMessage _message = new MailMessage();
_message.From = new MailAddress(from, fromName);
_message.To.Add(mailto);
_message.Subject = "Название письма";
_message.Body = "То, что в письме";
_smtpServer.Port = port;
_smtpServer.Credentials = new System.Net.NetworkCredential(username, password) as ICredentialsByHost;
_smtpServer.EnableSsl = true;
ServicePointManager.ServerCertificateValidationCallback =
delegate (object s, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
{ return true; };
_smtpServer.Send(_message);
_message.Dispose();
Debug.Log("Success");
}
}
Это мой первый опыт, что бы что-то отправлять по email. Все работает в версии для пк, но не работает в браузере.
Цитата Vostrugin (

)
Как пытаетесь отправить? Самое первое, что в приходит в голову, это отправлять с клиента только реквест с данными на сервис, который будет заниматься отправкой.
У меня была такая мысль, но т.к. раньше с таким не сталкивался не знаю куда копать