0
Good morning, I am developing an application in which I need to take a String Array and send by Email directly from the application, would anyone have any notion of how I can do this ? Thank you
0
Good morning, I am developing an application in which I need to take a String Array and send by Email directly from the application, would anyone have any notion of how I can do this ? Thank you
0
Hello, I can give you an example I have done in C#, just pass as parameter your string array.
public static void SendEmail(string email, string subject, string[] mensagem, String[] comCopia = null)
{
NetworkCredential("[email protected]", "password");
var assunto = subject;
var emailObj = email;
var mensagemObj = mensagem;
string from = new MailAddress("[email protected]", subject).ToString();
SmtpClient client = new SmtpClient("111.111.111.111")
{
UseDefaultCredentials = true,
Credentials = new NetworkCredential("[email protected]", "password"),
Port = 587
};
//string Server_Name = "http://" + Request.ServerVariables["server_name"] == "localhost" ? Request.ServerVariables["HTTP_HOST"] : Request.ServerVariables["server_name"] + "/project";
var html = string.Format("<p>Email: {0}</p>><p>Mensagem: {1}</p>",
email, mensagem);
var msg = new MailMessage(from, emailObj, assunto, mensagemObj) { IsBodyHtml = true };
if (comCopia!=null)
{
for (int i = 0; i < comCopia.Length; i++)
{
msg.CC.Add(comCopia[i]);
}
}
client.Send(msg);
}
Browser other questions tagged android
You are not signed in. Login or sign up in order to post.
Please explain the problem further, and if possible include a example of code that reproduces what is happening, because your question is not perceptible. See Help Center How to Ask.
– Jorge B.