button click event
protected void btnUpload_Click(object sender, EventArgs e)
{
string filepath;
if(resumeUpload.HasFile)
{
filepath = resumeUpload.PostedFile.FileName;
string body = "My Name :" + txtNamec.Text + "
I am a" + ddlGender.SelectedItem.Text + "
My Email :" + txtEmailc.Text + "
My Mobile No :" + txtMobile.Text + "
Course :" + txtCourse.Text + "
Location" + txtLocation.Text;
I am a" + ddlGender.SelectedItem.Text + "
My Email :" + txtEmailc.Text + "
My Mobile No :" + txtMobile.Text + "
Course :" + txtCourse.Text + "
Location" + txtLocation.Text;
Label1.Text = sv.carrer(body,filepath);
}
}
my class
public string carrer(string email,string filepath)
{
try
{
string to = "[email protected]";
string from = "[email protected]";
MailMessage msg = new MailMessage(from, to);
string mailbody = email;
msg.Subject = "Smart Vidyarthi Call Back";
msg.Body = mailbody;
msg.Attachments.Add(new Attachment(filepath));
msg.BodyEncoding = Encoding.UTF8;
msg.IsBodyHtml = true;
msg.Priority = MailPriority.High;
SmtpClient client = new SmtpClient("smtp.gmail.com", 587);
System.Net.NetworkCredential basicredenital = new System.Net.NetworkCredential("[email protected]", "password");
client.EnableSsl = true;
client.UseDefaultCredentials = false;
client.Credentials = basicredenital;
client.Send(msg);
return "Message Has Been Sent";
}
catch (Exception ex)
{
throw ex;
}
}
exception: file not found eception


Rajeesh MenothRank #118 · 18.4K reputationPosted Sep 10, 2015, 4:38 AM EDT
Susanta RoutRank #1,557 · 1K reputationPosted Sep 10, 2015, 10:26 PM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Sep 10, 2015, 10:34 PM EDT
Susanta RoutRank #1,557 · 1K reputationPosted Sep 10, 2015, 10:46 PM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Sep 10, 2015, 10:54 PM EDT
Susanta RoutRank #1,557 · 1K reputationPosted Sep 11, 2015, 3:47 AM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Sep 11, 2015, 3:49 AM EDT
Raja TRank #685 · 3.5K reputationPosted Sep 11, 2015, 3:59 AM EDT
Susanta RoutRank #1,557 · 1K reputationPosted Sep 11, 2015, 4:20 AM EDT
I am a" + ddlGender.SelectedItem.Text + "
My Email :" + txtEmailc.Text + "
My Mobile No :" + txtMobile.Text + "
Course :" + txtCourse.Text + "
Location" + txtLocation.Text;
Rajeesh MenothRank #118 · 18.4K reputationPosted Sep 11, 2015, 4:24 AM EDT
Raja TRank #685 · 3.5K reputationPosted Sep 11, 2015, 4:28 AM EDT
Susanta RoutRank #1,557 · 1K reputationPosted Sep 11, 2015, 4:30 AM EDT
I am a" + ddlGender.SelectedItem.Text + "
My Email :" + txtEmailc.Text + "
My Mobile No :" + txtMobile.Text + "
Course :" + txtCourse.Text + "
Location" + txtLocation.Text;
Raja TRank #685 · 3.5K reputationPosted Sep 11, 2015, 4:35 AM EDT
Susanta RoutRank #1,557 · 1K reputationPosted Sep 11, 2015, 4:38 AM EDT
Susanta RoutRank #1,557 · 1K reputationPosted Sep 11, 2015, 4:39 AM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Sep 11, 2015, 4:54 AM EDT
Deepak Thapa56 reputationPosted Oct 3, 2015, 1:07 AM EDT