How To Make a ScreenShot Emailer
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
2 posts
Page 1 of 1
let me know guys if someone already made this
first make your form with two buttons(i made mine with pictureboxes so change all of them to button or button)
then make another button and make the text
make one checkbox the text for checkbox is
then form2 code
then make settings named
![Image]()
first make your form with two buttons(i made mine with pictureboxes so change all of them to button or button)
then make another button and make the text
Code: Select all
then make a picturebox and name it picturebox3 make a new form and call it Form2.vb make 5 textboxes and name them
Mail Settings
Code: Select all
From
Code: Select all
Password
Code: Select all
Who_To
Code: Select all
subject
Code: Select all
thenbody
make one checkbox the text for checkbox is
Code: Select all
and lastly add one button saying ok go back to form1 and put this code Password Text Safe On/Off
Code: Select all
notify me for any errorsImports System.Net.Mail
Public Class Form1
Dim from As String = My.Settings.from
Dim pass As String = My.Settings.pass
Dim whoto As String = My.Settings.whoto
Dim subject As String = My.Settings.subject
Dim body As String = My.Settings.body
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click
Me.Visible = False
Dim Bounds As Rectangle
Dim ScreenShot As System.Drawing.Bitmap
Dim Gfx As Graphics
Bounds = Screen.PrimaryScreen.Bounds
ScreenShot = New System.Drawing.Bitmap(Bounds.Width, Bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)
Gfx = Graphics.FromImage(ScreenShot)
Gfx.CopyFromScreen(Bounds.X, Bounds.Y, 0, 0, Bounds.Size, CopyPixelOperation.SourceCopy)
PictureBox3.Image = ScreenShot
Me.Visible = True
PictureBox3.Image.Save("your file name.jpg")
End Sub
Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox2.Click
Dim MyMailMessage As New MailMessage
MyMailMessage.From() = New MailAddress(from)
MyMailMessage.To.Add(whoto)
MyMailMessage.Subject = (subject)
MyMailMessage.Body = (body)
MyMailMessage.Attachments.Add(New System.Net.Mail.Attachment("your file name.jpg"))
Dim SMTP As New SmtpClient("smtp.gmail.com")
SMTP.Port = 587
SMTP.EnableSsl = True
SMTP.Credentials = New System.Net.NetworkCredential(from, pass)
SMTP.Send(MyMailMessage)
MsgBox("may take a while", MsgBoxStyle.OkOnly, "sending...")
End Sub
Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MailBtn.Click
Form2.Show()
End Sub
End Class
then form2 code
Code: Select all
Public Class Form2
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Office2007ColorTable = DevComponents.DotNetBar.Rendering.eOffice2007ColorScheme.VistaGlass
From.Text = My.Settings.from
Password.Text = My.Settings.pass
Who_To.Text = My.Settings.whoto
subject.Text = My.Settings.subject
body.Text = My.Settings.body
End Sub
Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
My.Settings.from = From.Text
My.Settings.pass = Password.Text
My.Settings.whoto = Who_To.Text
My.Settings.subject = subject.Text
My.Settings.body = body.Text
My.Settings.Save()
Me.Close()
End Sub
Private Sub CheckBoxX1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
If CheckBox1.Checked = True Then
Password.UseSystemPasswordChar = True
Me.Invalidate()
ElseIf CheckBox1.Checked = False Then
Password.UseSystemPasswordChar = False
Me.Invalidate()
End If
End Sub
End Class
then make settings named
Code: Select all
from
Code: Select all
pass
Code: Select all
whoto
Code: Select all
subject
Code: Select all
and it should be done here is my image body

i dont think anyone has made this yet good job its good for a error reporting system
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that 

2 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023