MailMessage msg = new MailMessage();
msg.From = new MailAddress(txtEmail.Text);
msg.To.Add("mymailid");
msg.IsBodyHtml = true;
msg.Body = "Name : " + txtname.Text + "
Email : " + txtEmail.Text + "
Phone : " + txtmobile.Text + "
Message : " + Txtmessage.Text + "
";
Email : " + txtEmail.Text + "
Phone : " + txtmobile.Text + "
Message : " + Txtmessage.Text + "
";
msg.Subject = txtSubject.Text;
SmtpClient smtpclient = new SmtpClient();
smtpclient.Host = "smtp.gmail.com";
smtpclient.Port = 587;
smtpclient.Credentials = new System.Net.NetworkCredential("mymailid", "password");
smtpclient.EnableSsl = true;
smtpclient.Send(msg);
Label1.Text = "Thanks for contacting us";
txtname.Text = "";
txtEmail.Text = "";
txtSubject.Text = "";
Txtmessage.Text = "";
txtmobile.Text = "";
}
catch(Exception ex)
{
Console.WriteLine("{0} Exeception caugh.",ex);
}
this code of mine working on local host but not working when i put it on server can an one suggest me what to do.
Dipankar BiswasPosted Aug 3, 2014, 8:38 AM
shilpa mittalPosted Aug 3, 2014, 6:31 AM
Dipankar BiswasPosted Aug 3, 2014, 6:21 AM
shilpa mittalPosted Aug 3, 2014, 3:20 AM
Dipankar BiswasPosted Aug 2, 2014, 1:47 PM