-1
Eae you guys, beauty?
I am making a very simple email Nder, but I found myself in a question that I can not solve...
My first idea was to get a temporary email address to use as a Sender... But after some research I discovered that it is impossible to do this... (If it’s possible give me a light please)
So I decided to simply camouflage the email so the recipient can’t see who actually sent the email.
In the image shows the email there network credentials, wanted to mask this guy...
My code:
const string EMAIL = "";
const string PASS = "";
const string HOST = "smtp.gmail.com";
const int PORT = 587;
public static bool sendMail(string mailDestine, string mailDestineDisplay, string mailSend, string mailSendDisplay, string title, string body) {
SmtpClient client = configureClient();
MailMessage mail = new MailMessage();
try {
mail.IsBodyHtml=true;
mail.Priority=MailPriority.High;
mail.Sender = new MailAddress(mailSend, mailSendDisplay);
mail.From = new MailAddress(mailSend, mailSendDisplay);
mail.To.Add(new MailAddress(mailDestine, mailDestineDisplay));
mail.Subject = title;
mail.Body = body;
client.Send(mail);
Console.WriteLine("SUCESS, MAIL SEND...");
return true;
} catch {
Console.WriteLine("ERROR...");
return false;
} finally {
mail.Dispose();
}
}
private static SmtpClient configureClient() {
SmtpClient client = new SmtpClient();
client.Host = HOST;
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Credentials = new NetworkCredential(EMAIL,PASS);
client.Port = PORT;
return client;
}
do not waste time with it... create a no-reply account...
– Leandro Angelo
With that does not fall into the spam box?
– Marccus Zavadzki