How to send the Mail in C# using ASP.Net ? And my Answer is
as follows ?

Answers were Sorted based on User's Feedback



How to send the Mail in C# using ASP.Net ? And my Answer is as follows ?..

Answer / 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

How to send the Mail in C# using ASP.Net ? And my Answer is as follows ?..

Answer / satya narayan sahoo

You can try using any other SMTP sevrer's IP in ur network.

Is This Answer Correct ?    0 Yes 0 No

How to send the Mail in C# using ASP.Net ? And my Answer is as follows ?..

Answer / rajesh

hi
i used the same code & not getting any error but not i am
not getting mail.
could u plz help me ?

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net General Interview Questions

What is Entity Relationship Model in .NET?

0 Answers   Viscus Infotech,


What is .net3.5?

0 Answers  


How can we convert XML data into DataBase table IN .Net?

3 Answers   Indus Media, Wipro,


Can you write a class without specifying namespace?

0 Answers  


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

0 Answers  


can any one tel me the complete Testing Procedure of any one simple PROJECT i mean either web/windows based application?

0 Answers  


What is Finalizer in .NET define Dispose and Finalize ?

0 Answers   MCN Solutions,


What is an interface and what is an abstract class? Please, expand by examples of using both. Explain why?

0 Answers  


What is Full trust permission set in .Net

0 Answers  


How can I tell if .net 3.5 is installed?

0 Answers  


What is concurrency? How will you avoid concurrency when dealing with dataset?

0 Answers  


Explain what is the difference between encrypting a password and applying a hashing?

0 Answers  


Categories