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
How to instantiate a delegate?
Difference between dispose and finallize method?
Describe the Managed Execution Process?
Compare client server application with n-tier application
Explain what is reflection in microsoft .net context?
Explain how to redirect tracing to a file?
What are the new thee features of com+ services, which are not there in com (mts)?
Is there any thread in our .net programs?
How does linq work?
What are the challenging issues you have faced in implementation project/Maintainance project in .net Functionality? How you have overcome that issue?
What is COM Interoperability in .NET
Differentiate between managed and unmanaged code?
What are code contracts?
What is reflection and what is it for?
Describe session handling in a webform, how does it work and what are the limitations?