0

Possible Duplicate:
System.Drawing.Image to stream C#

 public static void SendHTMLEmail(Page p, string to, string subject, string content, System.Drawing.Image img)
        {
            MailMessage message = new MailMessage(); 
            message.IsBodyHtml = true;
            message.From = new MailAddress("myemail@gmail.com");

            message.To.Add(new MailAddress(to));

            //message.CC.Add(new MailAddress("carboncopy@foo.bar.com"));
            message.Subject = subject;
            message.Body = content;

            AlternateView htmlBody = AlternateView.CreateAlternateViewFromString(content, Encoding.UTF8, "text/html");

            Stream s = new MemoryStream();

            //s.re

            LinkedResource pic = img; (Cannot assign an image to pic)

Since the pic requires a stream. I don't know how to read an image to a stream.

Please help.

Community
  • 1
  • 1
Franva
  • 6,565
  • 23
  • 79
  • 144

0 Answers0