0

I have a form which uploads an image to the server, and I am abl to get the filename of the image and other data inside the form.

How would I convert the image to string to be included in a html email?

This is the code which gives me my filename.

string PostedFileName = "not_set";
foreach (string fileName in HttpContext.Current.Request.Files)
{
    HttpPostedFile file = HttpContext.Current.Request.Files[fileName];
    PostedFileName = fileName;
}
MessageSent("TRUE - " + PostedFileName);
Tim Rideyourbike
  • 667
  • 1
  • 6
  • 14
  • http://stackoverflow.com/questions/1921275/sending-an-email-with-an-image-embedded-in-the-body-from-c-sharp ? – Donnelle Mar 11 '15 at 03:05
  • @Donnelle that link shows how to embed an image into a html email. I am asking **how to convert this uploaded image to a format which can be embedded** into a html email. – Tim Rideyourbike Mar 11 '15 at 04:11
  • Is it possible to get file path here? If you are able to get file path we can attach image in the html mail. using alternative view concept. – Keerthi Kumar Mar 11 '15 at 04:31
  • I don't want to save the image to the server, I just have it sitting in the HttpContext.Current.Request.Files after being posted via an ajax form. – Tim Rideyourbike Mar 11 '15 at 05:09
  • https://haseebmukhtar.wordpress.com/2011/11/15/c-embed-images-in-email-embedded-images-not-attachment/ – Donnelle Mar 11 '15 at 23:32

0 Answers0