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
What's a windows process in .net?
What is .net latest version?
How boxing and unboxing occures in memory?
Is .net core managed code?
What tools can I use to develop .net applications?
What are an object and a class?
What is the difference between an abstract class and an interface?
What is "common language specification" (cls) in .net?
With these events, why wouldn't microsoft combine invalidate and paint, so that you wouldn't have to tell it to repaint, and then to force it to repaint?
Differences between datagrid, datalist and repeater in .net?
What versions of .net are there?
What is RCW (Run time Callable Wrappers)?
which methos do you invoke on the dataadapter control to load your generated dataset with data?
What is the difference between task and thread in .net?
Difference between dispose and finallize method?