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 Help Members By Posting Answers For Below Questions

What's a windows process in .net?

542


What is .net latest version?

549


How boxing and unboxing occures in memory?

614


Is .net core managed code?

526


What tools can I use to develop .net applications?

573






What are an object and a class?

570


What is the difference between an abstract class and an interface?

510


What is "common language specification" (cls) in .net?

546


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?

516


Differences between datagrid, datalist and repeater in .net?

537


What versions of .net are there?

623


What is RCW (Run time Callable Wrappers)?

1963


which methos do you invoke on the dataadapter control to load your generated dataset with data?

556


What is the difference between task and thread in .net?

609


Difference between dispose and finallize method?

667