hello this is the code i am using:
private String SendMail(String CorreoDestino, String Asunto, String Cuerpo)
{
try
{
MailMessage mail = new MailMessage();
SmtpClient SmtpServer = new SmtpClient("hp88.hostpapa.com");
mail.From = new MailAddress("
[email protected]", "Host", Encoding.UTF8);
mail.Subject = Subject;
mail.Body = Body;
mail.To.Add(CorreoDestino);
SmtpServer.Port = 25;
SmtpServer.Credentials = new System.Net.NetworkCredential("
[email protected] ", "password");
SmtpServer.EnableSsl = true;
SmtpServer.Send(mail);
return "Enviado";
}
catch (Exception ex)
{
return ex.Message.ToString();
}
the sender button:
protected void btnEnviar_Click(object sender, EventArgs e)
{
string TextToSend = txtTextToSend.Text;
String MenConfirmacion = "";
MenConfirmacion = SendMail("
[email protected]", "e-mai header", TextToSend);
lblmen.Text = Mensaje;
}