i am creating a job portal website in which i have added a upload button.
whenever a user posts his resume i must get the resume through email.
Please help me
Problem in uploading attachment
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Khargesh RajputRank #616 · 3.9K reputationPosted Mar 26, 2015, 6:05 AM EDT
Khargesh RajputRank #616 · 3.9K reputationPosted Mar 26, 2015, 8:15 PM EDT
on applybutton click
MailMessage mail = new MailMessage();
mail.To.Add(lblempemail.Text.TrimEnd(','));
mail.From = new MailAddress("emailid");
mail.IsBodyHtml = true;
mail.Body = "html body code";
DataSet objds3 = new DataSet();
string resume = "select resumes from newregistration where email='" + Session["userid"].ToString() + "'";
objds3 = objdal.FillDataSet(CommandType.Text, resume);
// if (dslog.Tables[0].Rows.Count > 0)
{
mail.Attachments.Add(new Attachment(Server.MapPath(objds3.Tables[0].Rows[0]["resumes"].ToString())));
//get resume path
}
SmtpClient smtp = new SmtpClient();
smtp.Host = "your host";
smtp.Port = 25;
smtp.EnableSsl = false;
smtp.Credentials = new System.Net.NetworkCredential("youremail", "password");
smtp.Send(mail);