0
[language =c#]
System.Net.Mail.MailMessage myMail = new System.Net.Mail.MailMessage();
        myMail.To.Add("someemailid.com");
        myMail.From = new MailAddress("someemailid@someemailid.com", "someemailid ", System.Text.Encoding.UTF8);
        myMail.Subject = "user Information";
        myMail.SubjectEncoding = System.Text.Encoding.UTF8;

        SmtpClient client = new SmtpClient();
        client.Host = "localhost";
        client.Port = 25;
        client.Send(myMail);

The above code i have used in asp.net page
Its showing client.Send(myMail) failed
//////////////////
the below code i have used in web.config file

<system.net>
    <mailSettings>
      <smtp from="customercare@mailaddress.com">
        <network host="smtp.mail.mailaddress.com" port="25" userName="something" password="pass" defaultCredentials="true" />
      </smtp>
    </mailSettings>
  </system.net>[/language]
2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by coollife
0

What is the error message that you receive?

You should not send email in response to a user's action. You should queue it and have a service process the queue every minute and send out the emails.

0

boss the error message i am getting is client.send(message) failed

Its not saying anything apart from that


One more thing for search engine optimization in HTML they use meta tags right.

In the same way we can use keywords(some code) in web.config file it seems
by team leader told . I am unable to find any such code

Help me

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.