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

How does u handle this COM components developed in other programming languages in .NET?

0 Answers  


Define satelite assembly?

0 Answers  


What is meant by .Net framework?

1 Answers  


What class does icon derive from? Isn't it just a bitmap with a wrapper name around it?

0 Answers  


What is connection pooling and how do you make your application use it?

0 Answers  






What is .net standard?

0 Answers  


Explain about managed heap?

0 Answers  


Describe the Managed Execution Process?

0 Answers  


What?s different about a Windows service as compared to a regular application?

1 Answers  


What is web.config in .net?

0 Answers  


What are possible implementations of distributed applications in .NET?

1 Answers  


Is .net front end or backend?

0 Answers  


Categories