Click here to Skip to main content
15,890,399 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
now i was develop a one project.i will include a upload folder all the image store that folder.. how to send a email in that image




pls help me...........

if (txtemail.Text != "")
{
try
{


// Mail Using Domain
MailMessage mM = new MailMessage();
mM.From = new MailAddress("kumar@availtechnologies.net", "Travel Invite");
mM.To.Add(new MailAddress(txtemail.Text));
mM.Subject = txtsubject.Text;


if (txtsubject.Text != "" && var.ToString() != "")
{
mM.Body = ConvertToHtmlFile(var.ToString());

}

mM.IsBodyHtml = true;
mM.Priority = MailPriority.High;
SmtpClient sC = new SmtpClient("webmail.availtechnologies.net");
sC.Port = 25;
sC.Credentials = new System.Net.NetworkCredential("kumar@availtechnologies.net", "seetha07");
//sC.EnableSsl = true;
sC.Send(mM);



}
catch (Exception ex)
{
Response.Write(ex.ToString());
}

}
}




XML
#region "Convert To  Html File"
  public static string ConvertToHtmlFile(string var )
  {

      string myHtmlFile = "";
      StringBuilder myBuilder = new StringBuilder();

      myBuilder.Append("<html xmlns='http://www.w3.org/1999/xhtml'>");
      myBuilder.Append("<head>");
      myBuilder.Append("<title>");
      myBuilder.Append("Page-");
      myBuilder.Append("Instant Enquiry");
      myBuilder.Append(Guid.NewGuid().ToString());
      myBuilder.Append("</title>");
      myBuilder.Append("</head>");
      myBuilder.Append("<body>");


      myBuilder.Append("<table width='1003' border='0' align='center' cellpadding='0' cellspacing='0'>");

      myBuilder.Append("<tr>");
      myBuilder.Append("<td>");

      myBuilder.Append("<table>");

      myBuilder.Append("<tr>");
      myBuilder.Append("<td background='http://availtechnologies.net/upload/ Down'+var+'.jpg' width='200'  height='42'>");
      myBuilder.Append("");
      myBuilder.Append("</td>");
      myBuilder.Append("</tr>");
      myBuilder.Append("" + var.ToString() + "");
      myBuilder.Append("</table>");



      myBuilder.Append("</table>");


      myBuilder.Append("</body>");
      myBuilder.Append("</html>");
      myHtmlFile = myBuilder.ToString();

      return myHtmlFile;



  }


  #region "Convert To Html File VISA"
  public static string ConvertToHtmlFileVisa(String visaamount)
  {
      string myHtmlFile = "";
      StringBuilder myBuilder = new StringBuilder();


      myBuilder.Append("<table width='980' border='0' align='center' cellpadding='0' cellspacing='0'>");
      myBuilder.Append("<tr>");
      myBuilder.Append("<td class='normaltxt1' width='415'>Visa Amount");
      myBuilder.Append("</td>");
      myBuilder.Append("<td class='normaltxt1' width='196'>" + visaamount.ToString() + "");
      myBuilder.Append("</td>");
      myBuilder.Append("<td class='normaltxt1' width='196'>&nbsp;");
      myBuilder.Append("</td>");
      myBuilder.Append("</tr>");

      myBuilder.Append("</table>");


      myHtmlFile = myBuilder.ToString();

      return myHtmlFile;
  }
  #endregion







Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900