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 the intermediate language between asp and asp.net1.0?

0 Answers  


How do we access crystal reports in .net?

0 Answers  


What is difference between .net and .net core?

0 Answers  


Writing a Stored procedure to insert the values into a table

1 Answers  


How to customize the trace output?

0 Answers  






Please explain when should you use .net web forms over asp.net mvc?

0 Answers  


What is garbage collection? Explain the difference between garbage collections in .net 4.0 and earlier versions?

0 Answers  


<li id="Accomodation" runat="server" visible="false"><a href="../searchaccommodation.aspx?">Accomm</a></li> i have this code.now on server side i want to compare this id(Accommodation) value and want id i.e.Accommodation.visible=true;

0 Answers  


Explain code access security.

0 Answers  


How big is the datatype int in .net?

0 Answers  


What is difference between .net core and .net standard?

0 Answers  


How inheritance works in .net?

0 Answers  


Categories