Home All Groups Group Topic Archive Search About

Emailing a form in Visual Basic 2005 Express

Author
19 Nov 2007 11:14 PM
Krystal VB Newbie
I am brand new to programming and was hoping that someone could tell me how
to take the next step in my windows application.  I need to be able to email
not just the contents of a form but an image, if you will, of the entire
form.  I have a form that my users will fill out and which contains labels as
well as text fields.  I have the program configured to email me and that part
is working.  I now need to figure out how to get the program to email that
entire form and all of its contents to me. Below is a sample of my code.


Imports System.Net.Mail
Public Class AdmissionsFinancialCounselor

    Private Sub Label12_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label12.Click
        Dim F2 As New MS4AdmiFinCoun

        F2.ShowDialog()


    End Sub

    Private Sub Label15_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Label15.Click
        Dim F2 As New MisysRad
        F2.ShowDialog()

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
        Dim message As New MailMessage("e***@sutterhealth.org",
"hard***@sutterhealth.org", "Account Request Form", "Account Request Form")
        Dim emailClient As New SmtpClient("dcsh1ex")
        emailClient.Send(message)

        MsgBox("Email Sent!")


    End Sub


    Private Sub AdmissionsFinancialCounselor_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class


Someone please help if you know what I'm talking about?

Author
20 Nov 2007 2:06 AM
Trevor Benedict
That's an example to do a screen capture.
http://www.vbdotnetheaven.com/UploadFile/mgold/ScreenCapturingForm04212005081136AM/ScreenCapturingForm.aspx

The next step is to save it to a temporary file, add it as an atatchement,
complete the email process and then remove the temporary file.

Regards,

Trevor Benedict
MCSD


Show quoteHide quote
"Krystal VB Newbie" <Krystal VB New***@discussions.microsoft.com> wrote in
message news:09F6637B-4720-4069-8ABF-EC5D24858C91@microsoft.com...
>I am brand new to programming and was hoping that someone could tell me how
> to take the next step in my windows application.  I need to be able to
> email
> not just the contents of a form but an image, if you will, of the entire
> form.  I have a form that my users will fill out and which contains labels
> as
> well as text fields.  I have the program configured to email me and that
> part
> is working.  I now need to figure out how to get the program to email that
> entire form and all of its contents to me. Below is a sample of my code.
>
>
> Imports System.Net.Mail
> Public Class AdmissionsFinancialCounselor
>
>    Private Sub Label12_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Label12.Click
>        Dim F2 As New MS4AdmiFinCoun
>
>        F2.ShowDialog()
>
>
>    End Sub
>
>    Private Sub Label15_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Label15.Click
>        Dim F2 As New MisysRad
>        F2.ShowDialog()
>
>    End Sub
>
>    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
>        Dim message As New MailMessage("e***@sutterhealth.org",
> "hard***@sutterhealth.org", "Account Request Form", "Account Request
> Form")
>        Dim emailClient As New SmtpClient("dcsh1ex")
>        emailClient.Send(message)
>
>        MsgBox("Email Sent!")
>
>
>    End Sub
>
>
>    Private Sub AdmissionsFinancialCounselor_Load(ByVal sender As
> System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
>
>    End Sub
> End Class
>
>
> Someone please help if you know what I'm talking about?
>
Author
20 Nov 2007 4:36 AM
Cor Ligthert[MVP]
Krystal,

You are using the default mail client at the moment. However, you cannot use
attachments on the default may client.


http://www.systemnetmail.com/

Have a look at this website.

Cor