title: Sending screenshot via C#
body: <p>I'm saving by capturing screenshot via that code.</p>
  
  <pre><code>Graphics Grf;
  Bitmap Ekran = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppPArgb);
  Grf = Graphics.FromImage(Ekran);
  Grf.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
  Ekran.Save("screen.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
  </code></pre>
  
  <p>Then send this saved screenshot as e-mail:</p>
  
  <pre><code>SmtpClient client = new SmtpClient();
  MailMessage msg = new MailMessage();
  msg.To.Add(kime);
  if (dosya != null)
  {
     Attachment eklenecekdosya = new Attachment(dosya);
     msg.Attachments.Add(eklenecekdosya);
  }
  msg.From = new MailAddress("aaaaa@xxxx.com", "Konu");
  msg.Subject = konu;
  msg.IsBodyHtml = true;
  msg.Body = mesaj;
  msg.BodyEncoding = System.Text.Encoding.GetEncoding(1254);
  NetworkCredential guvenlikKarti = new  NetworkCredential("bbbb@bbbb.com", "*****");
  client.Credentials = guvenlikKarti;
  client.Port = 587;
  client.Host = "smtp.live.com";
  client.EnableSsl = true;
  client.Send(msg); 
  </code></pre>
  
  <p>I want to do this : How can I send a screenshot directly as e-mail via smtp protocol without saving?</p>