string body = "My Name :" + txtNamec.Text + "<br/>I am a" + ddlGender.SelectedItem.Text + "<br/>My Email :" + txtEmailc.Text + "<br/>My Mobile No :" + txtMobile.Text + "<br/> Course :" + txtCourse.Text + "<br/> Location" + txtLocation.Text;
public string carrer(string email,string filepath)
{
try
{
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