Jump to content

auto login & sender vb6

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
6 replies to this topic

#1
J1990

J1990

    Newbie

  • Members
  • Pip
  • 5 posts
hey all,

i am trying to make a program in vb6 that logs you in to hotmail and then sends an email.
i load the site into a webbrowsers component and the login part is working allready.
this is what i've got so far:
Option Explicit

Dim inp2 As MSHTML.HTMLRichtextElement

Public StartingAddress As String

Dim mbDontNavigateNow As Boolean

Private Sub Command1_Click()

'here starts the login part

frmBrowser.brwWebBrowser.Document.All.Item("login").Value = Text1.Text

frmBrowser.brwWebBrowser.Document.All.Item("passwd").Value = Text2.Text

If brwWebBrowser.Document.All.Item("remMe").Checked = True Then brwWebBrowser.Document.All.Item("remMe").Click

frmBrowser.brwWebBrowser.Document.body.All.Item("SI").Click

End Sub


Private Sub Command2_Click()

'On Error Resume Next

'Me.Caption = "Clicked the page " & Timer

'brwWebBrowser.Document.All.Item("SendMessage").Click

'brwWebBrowser.Document.All.Item("RichTextEditor").Text = "mytext"

'MsgBox brwWebBrowser.Document.all.item("RichTextEditor").Value

'brwWebBrowser.Document.All.Item("AutoCompleteTo$InputBox").Value = "kipsate"

'Dim inp1 As MSHTML.HTMLDocument

'Set inp1 = brwWebBrowser.Document

'MsgBox

brwwebbrowser.document.all.item("SendMessage").Click 'this gives an error

End Sub


Private Sub Form_Load()

    On Error Resume Next

  

    cboAddress.Text = "hotmail" '"D:\\bureaublad\new catalogs.htm"

    Me.Show

    tbToolBar.Refresh

    Form_Resize


    cboAddress.Move 50, lblAddress.Top + lblAddress.Height + 15


    If Len(StartingAddress) > 0 Then

        cboAddress.Text = StartingAddress

        cboAddress.AddItem cboAddress.Text

        'try to navigate to the starting address

        timTimer.Enabled = True

        brwWebBrowser.Navigate StartingAddress

    End If

cboAddress_Click

Form1.Show


End Sub




Private Sub brwWebBrowser_DownloadComplete()

    On Error Resume Next

    Me.Caption = brwWebBrowser.LocationName

    'If brwWebBrowser.LocationURL = "login.live." Then


'End If


End Sub


Private Sub brwWebBrowser_NavigateComplete(ByVal URL As String)

    Dim i As Integer

    Dim bFound As Boolean

    Me.Caption = brwWebBrowser.LocationName

    For i = 0 To cboAddress.ListCount - 1

        If cboAddress.List(i) = brwWebBrowser.LocationURL Then

            bFound = True

            Exit For

        End If

    Next i

    mbDontNavigateNow = True

    If bFound Then

        cboAddress.RemoveItem i

    End If

    cboAddress.AddItem brwWebBrowser.LocationURL, 0

    cboAddress.ListIndex = 0

    mbDontNavigateNow = False

    brwWebBrowser.Document.All.Item("login").Value = ""

brwWebBrowser.Document.All.Item("passwd").Value = ""

brwWebBrowser.Document.body.All.Item("SI").Click

Command1_Click

End Sub


Private Sub cboAddress_Click()

    If mbDontNavigateNow Then Exit Sub

    timTimer.Enabled = True

    brwWebBrowser.Navigate cboAddress.Text

End Sub


Private Sub cboAddress_KeyPress(KeyAscii As Integer)

    On Error Resume Next

    If KeyAscii = vbKeyReturn Then

        cboAddress_Click

    End If

End Sub


Private Sub Form_Resize()

    cboAddress.Width = Me.ScaleWidth - 100

    brwWebBrowser.Width = Me.ScaleWidth - 100

    brwWebBrowser.Height = Me.ScaleHeight - (picAddress.Top + picAddress.Height) - 100

End Sub


Private Sub timTimer_Timer()

    If brwWebBrowser.Busy = False Then

        timTimer.Enabled = False

        Me.Caption = brwWebBrowser.LocationName

    Else

        Me.Caption = "Working..."

    End If

End Sub


Private Sub tbToolBar_ButtonClick(ByVal Button As Button)

    On Error Resume Next

     

    timTimer.Enabled = True

     

    Select Case Button.Key

        Case "Back"

            brwWebBrowser.GoBack

        Case "Forward"

            brwWebBrowser.GoForward

        Case "Refresh"

            brwWebBrowser.Refresh

        Case "Home"

            brwWebBrowser.GoHome

        Case "Search"

            brwWebBrowser.GoSearch

        Case "Stop"

            timTimer.Enabled = False

            brwWebBrowser.Stop

            Me.Caption = brwWebBrowser.LocationName

    End Select


End Sub


Public Function loginemail(sender As String)




End Function


so what my problem is, i can't get it to click on a toolbar button wich you need to send an email. and i also can not find out how to set the subject of the email, how to set the text of the email and who to send it to

#2
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts
Do you want it to log in or just send the email? Because if you only want to send an email you can do it in a much easier way.

#3
J1990

J1990

    Newbie

  • Members
  • Pip
  • 5 posts
i want it to let it send an email

#4
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts
Check out this tutorial: http://forum.codecal...ing-emails.html

It's for VB.NET so if you have any problems let me know.

#5
J1990

J1990

    Newbie

  • Members
  • Pip
  • 5 posts
thank you for your reply now that i see it it looks simple but the only problem i have is that i can't do this

Quote

First we need to import this:

Code:

Imports System.Net.Mail


i have scrolled through the references but i couldn't find it.
so if you could tell me how to do this in vb6, thta would be nice.

#6
Vswe

Vswe

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 9,552 posts
I thought it existed in vb6 too. I'm sorry then. What toolbar button do you want to get clicked?

#7
J1990

J1990

    Newbie

  • Members
  • Pip
  • 5 posts
so there is no way of doing it in vb6?
i don't know if you are familiar with hotmail but when you start and login you need to press the new, as in email, button. i found out that it is a toolbar button

btw i added you to my msn