How can I send an email with c#.net in vs2010 professional.I searched many forum threads and links but none of them works.
I use the following code but the error message appears as
Cannot get IIS pickup directory.
my code is :
protected void sendbtn_Click(object sender, EventArgs e)
{
SmtpClient client = new SmtpClient();
MailMessage mesaj = new MailMessage();
mesaj.To.Add(totxt.Text);
mesaj.CC.Add(cctxt.Text);
mesaj.Bcc.Add(bcctxt.Text);
mesaj.From = new MailAddress(fromtxt.Text);
mesaj.Subject = subjecttxt.Text;
mesaj.Body = desctxt.Text;
mesaj.IsBodyHtml = true;
mesaj.Priority = MailPriority.High;
NetworkCredential nc = new NetworkCredential(fromtxt.Text, passwordtxt.Text);
client.Credentials = nc;
client.Port = 587;
client.Host = "smtp.gmail.com";
client.EnableSsl = fal ...
Go to the complete details ...