using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net.Mail;
using System.Net;
namespace WebApplication2
{
public partial class ContactUs : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Submit_Click(object sender, EventArgs e)
{
try
{
MailMessage msg = new MailMessage();
msg.To.Add("[email protected]");
MailAddress address = new MailAddress(txtEmail.Text);
msg.From = address;
msg.ReplyToList.Add(address);
msg.Subject = txtName.Text + " : " + txtSubject.Text;
msg.Body = txtDescription.Text;
SmtpClient client = new SmtpClient("smtp.gmail.com", 25);
client.EnableSsl = true;
NetworkCredential credentials = new NetworkCredential("[email protected]", "extentia");
client.Credentials = credentials;
client.Send(msg);
lblMessage.Text = "Your message was sent!";
txtEmail.Text = "";
txtSubject.Text = "";
txtName.Text = "";
txtDescription.Text = "";
}
catch
{
lblMessage.Text = "Your message failed to send, please try again.";
}
}
}
}
}
cant able to send mail from my website
Amit KumarPosted Oct 5, 2017, 6:49 AM
Susanta RoutPosted Nov 13, 2017, 2:09 AM
Ekrem TapanPosted Oct 6, 2017, 6:05 AM
Ankit SharmaPosted Oct 6, 2017, 3:39 AM
sam samuelPosted Oct 6, 2017, 3:14 AM
Sundaram SubramanianPosted Oct 6, 2017, 1:35 AM
Ankit SharmaPosted Oct 5, 2017, 6:49 AM