How to send the Mail in C# using ASP.Net ? And my Answer is
as follows ?
Answer Posted / sharifuddin
MailMessage mail = new MailMessage();
mail.To = txtto.Text;
mail.From = txtfrom.Text;
mail.Subject = txtsub.Text;
mail.Body = txtmsg.Text;
mail.Priority = MailPriority.High;
SmtpMail.SmtpServer =
SmtpMail.SmtpServer.ToString();
try
{
SmtpMail.Send(mail);
Label6.Text = " Message sent Succesfully....";
}
catch (Exception ex)
{
Label5.Text = "";
Label6.Text = " Message sent Failed.. " +
ex.Message;
}
But The When I sent it gives the error as :"The transport
failed to connect to the server."
Could you please help me....?
Thank you..
me.sharifuddin@gmail.com
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain what is the difference between odbc and ado?
Explain Creational design pattern in .NET?
State some of the different languages supported by .net?
Explain the difference between managed and unmanaged code?
Differentiate between 'DataSet' and 'SQLDataReader' in ADO.NET?
Please explain what is the difference between constants and read-only variables?
What is difference between .net and .net core?
What are the new features in .net core?
What does jit compilation do in .net?
What is meant by globalization?
Can I write my own .net host?
What is singlecall activation mode used for in .net?
What is Ajax design pattern in .NET?
Explain the use of activex control in .net?
What is assemblies in .net?