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

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

0 Answers  


Differences between dll and exe?

0 Answers  


What's the .net collection class that allows an element to be accessed using a unique key?

0 Answers  


Please explain is the jit an interpreter?

0 Answers  


How do you start, pause, continue or stop a Windows service off the command line?

1 Answers  






Best Dot Net Center in Chennai ?

1 Answers  


What is a resource? Provide an example from your recent project.

1 Answers   Wipro,


What is RunTime Polymorphism?

5 Answers   Deloitte, eClerx, Horizon, Intel, Pragna Technologies,


What is CCW (COM Callable Wrapper) ?

1 Answers  


What's the use of system.diagnostics.process class in .net?

0 Answers  


How would ASP and ASP.NET apps run at the same time on the same server?

1 Answers  


How to Create and Consume a Web Service?

1 Answers  


Categories