February 22nd, 2000, 09:31 PM
how do you send an e-mail by using vb6. I want to make a program that could be sent to someone and after they fill out the information they click on 'get results' and all the information that they typed in is then sent to me with out them knowing that. if they know that i'm getting the information they might lie about it. So can you help me with the code for sending a string of information?
if you can e-mail me at vbbasic6@yahoo.com
thank you
Cakkie
February 23rd, 2000, 12:01 AM
First of all, I would like to note you on the fact that this is not a good thing to do, this is even illegal in some countries so be aware of what you are going to do with your gathered info. .
' add a winsock control to your form
' then paste this code
private sub SendInfoWithoutThemKnowing
winsock1.remoteport = 25
winsock1.remotehost = "your.mail.server.here" ' eg: mail.dma.be
winsock1.connect
end sub
private sub winsock1_connect()
'gathering all information and put it in a single string
strmsg = "HELO " & winsock1.localhostip & vbcrlf
strmsg = strmsg & "MAIL FROM:<" & txtEmail.text & ">" & vbcrlf
strmsg = strmsg & "RCPT to:<" & "your email here" & ">" & vbcrlf
strmsg = strmsg & "DATA" & vbcrlf
strmsg = strmsg & "to: " & "your name here"
strmsg = strmsg & "FROM: " & txtFirstName.text & " " & txtSirName & vbcrlf
strmsg = strmsg & "SUBJECT: " & "your subject here" & vbcrlf & vbcrlf
strmsg = strmsg & "Hi, this is input from one of your programs. I'm secretly "
strmsg = strmsg & "sending this info without them knowing." & vbcrlf
strmsg = strmsg & "Name: " & txtFirstName.text & " " & txtSirName.text & vbcrlf
.
. 'repeat for every peace of data you want to send
.
strmsg = strmsg & vbcrlf & "." & vbcrlf
strmsg = strmsg & "QUIT" & vbcrlf
winsock1.senddata strmsg
end sub
private sub GetResults_click()
'when the get results button is pressed
'do some stuff you need to do
SendInfoWithoutThemKnowing
end sub
Tom Cannaerts
slisse@planetinternet.be
The best way to escape a problem, is to solve it.