SRL Archive - C#/Visual Basic Help and Tutorials

How to send 2 textbox values to email?


L3nnuk

2007-08-16 18:29:27

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~

2007-08-16 20:21:26

 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

2007-08-17 08:51:56

thankz i got it working

Negaal

2007-10-09 11:18:09

Sounds like keylogger… is it?

Lacky

2007-10-13 22:21:38

Or a user and pass grabber.

Laimonas171

2008-11-10 13:11:41

how it make at VB6 that one doesnt work on it..