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

Explain how to redirect tracing to a file?

549


Explain the differences between server-side code and client-side code.

562


What is the difference between boxing and unboxing?

536


Can you write a class without specifying namespace?

577


Using com component in .net?

596






How to implement getcommon method in class a? Are you seeing any problem in the implementation?

622


What is managed code in .NET?

638


Explain how viewstate is being formed and how it's stored on client in .net?

541


Is .net a programming language?

528


What are Attributes in .NET?

581


How we can achieve Connection pooling in .Net?

643


What are asp.net authentication providers and iis security?

530


What is interface and abstract class in .net?

552


Explain the top .net class that everything is derived from?

549


What's typical about a windows process in regards to memory allocation in .net?

575