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
Explain how to redirect tracing to a file?
Explain the differences between server-side code and client-side code.
What is the difference between boxing and unboxing?
Can you write a class without specifying namespace?
Using com component in .net?
How to implement getcommon method in class a? Are you seeing any problem in the implementation?
What is managed code in .NET?
Explain how viewstate is being formed and how it's stored on client in .net?
Is .net a programming language?
What are Attributes in .NET?
How we can achieve Connection pooling in .Net?
What are asp.net authentication providers and iis security?
What is interface and abstract class in .net?
Explain the top .net class that everything is derived from?
What's typical about a windows process in regards to memory allocation in .net?