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
As you know read-only variables and constants have many similarities, but what is at least one way that they differ?
Why you want to leave your previous company.
How to implement datagrid in.net? How would you make a combo-box appear in one column of a datagrid? What are the ways to show data grid inside a data grid for a master details type of tables? If we write any code for datagrid methods. What is the access specifier used for that methods in the code behind file and why?
Whate are resource files?
What is dot net and its uses?
What is the native image generator?
Please explain what do the terms “boxing” and “unboxing” mean?
How does the generational garbage collector in the .net clr manage object lifetime? What is non-deterministic finalization?
Explain the different types of proxy patterns?
Can you edit data in repeater control? How?
What does cli do?
Which dll translate xml to sql in internet information server (iis)?
Explain how does assembly versioning work?
What are the different types of memory in .net?
What is the difference between asp.net and asp?