I made a little application that captures the screen using this code:
Bitmap b = new Bitmap(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height);
Graphics g = Graphics.FromImage(b);
g.CopyFromScreen(Point.Empty,Point.Empty,Screen.PrimaryScreen.WorkingArea.Size);
Now i want to attach the screenshot to a mail. I already wrote the neccesary code for sending the mail and all I want is to attach the image. Here is the code that I used for the mail:
MailMessage message = new MailMessage();
message.From = new MailAddress("mail_address@gmail.com");
message.Subject = "Subject";
message.Body = "Body";
message.To.Add("mail_address@gmail.com");
SmtpClient client = new SmtpClient();
client.Credentials = new NetworkCredential("mail_address@gmail.com", "password");
client.Host = "smtp.gmail.com";
client.Port = 587;
client.EnableSsl = true;
client.Send(message);
Can you help me with this? Thank you.