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
Please explain what is reflection and what is it for?
What do you mean by web service?
What is the use of immutability?
hai, about trading domain and need simple project on trading system. please help me...
What is a windows process in .net?
Please explain what do the terms “boxing” and “unboxing” mean?
Is .net is a language?
Explain what are the deferred execution and the immediate execution in linq?
How does linq work?
Explain security measures exist for .net remoting in system.runtime.remoting?
Tell us what is json data, and what is one way that .net developers can work with json?
Describe the difference between inline and code behind which is best in a loosely coupled solution?
What is func in .net 3.5?
What is the use com component in .net?
What is new in .net core?