protected void Upload_Click(object sender, EventArgs e) { String s = (String)Session["temp"]; if (FileUpload1.HasFile) { // string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName); // FileUpload1.PostedFile.SaveAs(Server.MapPath("~/" + s + "\\") + fileName); string fileName = Path.GetFileName(FileUpload1.PostedFile.FileName); path = Server.MapPath("~/" + s + "\\") + fileName; FileUpload1.SaveAs(path); Response.Redirect(Request.Url.AbsoluteUri); insert imges // Session["PATH"] = path; } protected void Send_Click(object sender, EventArgs e) { String sndps=(String)Session["pswd"]; // String s = (String)Session["PATH"]; String s = (String)Session["temp"]; String em = (String)Session["email"]; //TextBox1.Text = em; MailMessage msg = new MailMessage(); string ActivationUrl = string.Empty; string emailid = string.Empty; SmtpClient smtp = new SmtpClient(); string emailId = em; msg.From = new MailAddress("a@gmail.com"); msg.To.Add(em); msg.Subject = "Conformation mail"; msg.Body ="Your Login Password is:"+sndps; msg.IsBodyHtml = true; // string[] files = Directory.GetFiles(path); /*foreach (string file in files) { Console.WriteLine(file); }*/ // msg.Attachments.Add( files); //new Attachment(files)); //// if (FileUpload1.HasFile) //// { // msg.Attachments.Add(new Attachment(files.)); //// } smtp.Host = "smtp.gmail.com"; smtp.EnableSsl = true; NetworkCredential NetworkCred = new NetworkCredential("a@gmail.com", "r"); smtp.UseDefaultCredentials = true; smtp.Credentials = NetworkCred; smtp.Port = 587; smtp.Send(msg); Response.Write("msg snd........"); //Session["temp1"] = Usernametxt.Text; //Session["temp2"] = emailtxt.Text; //Response.Redirect("http://localhost:62874/MapExtractor/MsgSendPage.aspx"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)