PDA

View Full Version : How to send 2 textbox values to email?



L3nnuk
08-16-2007, 10:29 PM
I am making a program, what sends 2 textbox values to my email.
Like: Textbox1 is the Text Title, in Textbox2 is text. When person writes to them and he will press button "Send", it will send me what he/she wrote to these textboxes.
I will be using Gmail.

So please be kind enough and post me this piece of code, what sends these 2 textbox values to my email ( if you can, provide with ports etc. ).

I am using visual basic 2005 express.

Thank you for your time!

~alex~
08-17-2007, 12:21 AM
Public Sub sendEmail()
Dim client As New SmtpClient("pop host", 587)

Try
client.Credentials = New NetworkCredential("Pop email", "Pop password")

Dim msg As New MailMessage("Pop email", "email addy to send to)

msg.Subject = "Subject"

msg.Body = (textbox1.text+textbox2.text)
client.Send(msg)
Catch ex As Exception
MsgBox("An exception has occured.", MsgBoxStyle.Critical, "Exception!")
End Try

End Sub

L3nnuk
08-17-2007, 12:51 PM
thankz i got it working

Negaal
10-09-2007, 03:18 PM
Sounds like keylogger... is it?

Lacky
10-14-2007, 02:21 AM
Or a user and pass grabber.

Laimonas171
11-10-2008, 06:11 PM
how it make at VB6 that one doesnt work on it..