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
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Khargesh RajputPosted Mar 27, 2015, 12:15 AM
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);
Khargesh RajputPosted Mar 26, 2015, 10:05 AM