private void button1_Click(object sender, EventArgs e)
{
string reciever = "recipent";
string subject = "subject";
string body = "body";
try
{
using (MailMessage message = new MailMessage("feedback@delwyntech.com", reciever)
{
Subject = subject,
Body = body
})
{
using (SmtpClient client = new SmtpClient("smtpout.secureserver.net", 465)
{
EnableSsl = true,
UseDefaultCredentials = false,
Credentials = new NetworkCredential("feedback@gowyn.com", "password")
})
{
client.Send(message);
}
}
}
catch (Exception mailException)
{
MessageBox.Show(mailException.Message);
}
}