E-mail & Modem Internet Conection Detection 
Author Message
 E-mail & Modem Internet Conection Detection

Two Questions :

1) Is it possible to send e-mail through VB and not as MAPI  (Directly
through the
program you create through VB and not using an other program like Outlook or
other). Please direct me to some source code or resourses or give me some
advise on this subject.

2) When you connect to the INTERNET with dial up connection the modem makes
a serial sound in the start and then it is silent. How can I detect when the
modem starts the dial up connection ?  (when this serial sound starts)

Thanks in advance,
/\/ikos



Mon, 27 May 2002 03:00:00 GMT  
 E-mail & Modem Internet Conection Detection
1) Yes
2) No
http://www.planet-source-code.com/vb/
Quote:

> Two Questions :

> 1) Is it possible to send e-mail through VB and not as MAPI  (Directly
> through the
> program you create through VB and not using an other program like Outlook or
> other). Please direct me to some source code or resourses or give me some
> advise on this subject.

> 2) When you connect to the INTERNET with dial up connection the modem makes
> a serial sound in the start and then it is silent. How can I detect when the
> modem starts the dial up connection ?  (when this serial sound starts)

> Thanks in advance,
> /\/ikos




Mon, 27 May 2002 03:00:00 GMT  
 E-mail & Modem Internet Conection Detection
Nikos,

You can use our IDSMail component to send mail via SMTP (Internet mail)
which only requires a connection to the internet and no mail client
installed at all.  For example:

Dim idsMail as Object
Set idsMail = CreateObject("IDSMailInterface32.Server")
idsMail.ObjectKey = "ABC123"
idsMail.MailSystem =IDSM_SYS_SMTP_POP
idsMail.SMTPServer = "myprovider.com"
idsMail.NewMessage



idsMail.Subject = "Meeting Agenda"
idsMail.Message = "Here is the agenda for the weekly meeting."
idsMail.AddAttachment "C:\MEETINGS\AGENDA.DOC"
idsMail.Send

IDSMail also includes a dialer object which will let you dial a
connection if required:

Dim idsDialer as Object
Set idsDialer = CreateObject("IDSMailInterface32.Dialer")
idsDialer.EntryName = "MyDialupConnection"
'  idsDialer.PhoneNumber = "555-1212"
idsDialer.UserName = "Myself"
idsDialer.Password = "TopSecret"
idsDialer.Dial

Regarding automatic detection of the modem beginning to dial, I don't
think that is possible unless the RAS API provides a message hook, and I
don't think that it does.

For more info on IDSMail, go to http://www.intuitive-data.com

--
Regards,

Eric June
Intuitive Data Solutions

----- IDSMail - The Universal E-mail Component  --------
Send/Rcv E-mail *EASILY* through SMTP/POP, VIM,
MAPI, MHS, Banyan VINES, Active Messaging, & CDO:
http://www.intuitive-data.com/idsmail.htm
----------------------------------------------------------------------------



Mon, 27 May 2002 03:00:00 GMT  
 E-mail & Modem Internet Conection Detection

Quote:
> 2) When you connect to the INTERNET with dial up connection the modem
makes
> a serial sound in the start and then it is silent. How can I detect when
the
> modem starts the dial up connection ?  (when this serial sound starts)

An easy way is to check for the existence of a window called
"Connecting to <ISP>" with the FindWindow API.  This window
is created when the modem starts dialling, even if it it's
not necessarily visible.

Regards, Otser.



Tue, 28 May 2002 03:00:00 GMT  
 E-mail & Modem Internet Conection Detection
OTSER wrote :

Quote:

> > [...] How can I detect when the modem starts the dial up
> > connection ?  (when this serial sound starts)

> An easy way is to check for the existence of a window called
> "Connecting to <ISP>" with the FindWindow API.  This window

But, it works only on English version of Windows...

Quote:
> is created when the modem starts dialling, even if it it's
> not necessarily visible.

> Regards, Otser.

--



Tue, 28 May 2002 03:00:00 GMT  
 E-mail & Modem Internet Conection Detection

Quote:
> OTSER wrote :

> > > [...] How can I detect when the modem starts the dial up
> > > connection ?  (when this serial sound starts)

RAS.

The following code was downloaded and modified by me. Here's the header from the
orignal.


' http://matthart.com
'
' This sample shows how to fire up a DUN (Dial Up Networking)
' connection and see if it is online. There are a lot more
' API functions available in the RAS API. You can download an excellent
' sample program from Microsoft called VB32RAS.EXE at:
' http://support.microsoft.com/support/downloads/dp2109.asp
'
' Christian Gustavo Riva gave me the NT dial version. Thanks Christian!

I'm using this to display the list of defined DUN connections (called Entries in
RAS),
connect to them thru program. I allow user to connect directly (from Explorer
for e.g.)
and still can capture that (using a timer with DUNConnected()); I display the
name
of connection actually used by user in that case.

Thanks, Matt. Powerful, short and cool. If you're listening, do I really need to
handle Win9X vs WinNT? How do I do that?

--
MikeC

Please reply to the group.

--------------------------------------

Option Explicit

Private Const RAS_MaxDeviceType = 16
Private Const RAS95_MaxDeviceName = 128
Private Const RAS95_MaxEntryName = 256

Private Type RASCONN95
    ' Set dwsize to 412.
    dwSize As Long
    hRasConn As Long
    szEntryName(RAS95_MaxEntryName) As Byte
    szDeviceType(RAS_MaxDeviceType) As Byte
    szDeviceName(RAS95_MaxDeviceName) As Byte
End Type

Private Type RASDEVINFO
    dwSize As Long
    szDeviceType(RAS_MaxDeviceType) As Byte
    szDeviceName(RAS95_MaxDeviceName) As Byte
End Type

Private Type RASENTRYNAME95
    ' Set dwsize to 264.
    dwSize As Long
    szEntryName(RAS95_MaxEntryName) As Byte
End Type

Private Declare Function RasEnumConnections Lib "RasApi32.DLL" Alias
"RasEnumConnectionsA" (lpRASConn As Any, lpCB As Long, lpcConnections As Long)
As Long
Private Declare Function RasEnumDevices Lib "RasApi32.DLL" Alias
"RasEnumDevicesA" (lprasdevinfo As Any, lpCB As Long, lpcConnections As Long) As
Long
Private Declare Function RasEnumEntries Lib "RasApi32.DLL" Alias
"RasEnumEntriesA" (ByVal Reserved As String, ByVal lpszPhonebook As String,
lpRASEntryName As Any, lpCB As Long, lpcEntries As Long) As Long

Public Sub DUNConnect(ByVal sConnection As String)
    Dim sCommand As String

    sCommand = "rundll rnaui.dll,RnaDial " & sConnection

    ' NT Version
    ' sCommand = "rasphone.exe " & Chr$(34) & sconnection & Chr$(34)

    Shell sCommand, vbNormalFocus
End Sub

Public Function DUNConnected(ByRef lbAny As ListBox) As String
    Dim lBufferSize As Long
    Dim l As Long
    Dim i As Long

    ReDim aDUNConnectionList(0 To 255) As RASCONN95
    Dim lCount As Long
    Dim sConnection As String

    aDUNConnectionList(0).dwSize = LenB(aDUNConnectionList(0)) '412

    lBufferSize = (UBound(aDUNConnectionList) - LBound(aDUNConnectionList) + 1)
* aDUNConnectionList(0).dwSize

    l = RasEnumConnections(aDUNConnectionList(0), lBufferSize, lCount)
    For l = 0 To lCount - 1
        sConnection = StrConv(aDUNConnectionList(l).szEntryName(), vbUnicode)
        sConnection = Left$(sConnection, InStr(sConnection, Chr$(0)) - 1)

        For i = 0 To lbAny.ListCount - 1
            If sConnection = lbAny.List(i) Then
                DUNConnected = sConnection
            End If
        Next
    Next
End Function

Public Sub DUNLoadEntryList(ByRef lbAny As ListBox)
    Dim lBufferSize As Long
    Dim l As Long

    ReDim aDUNEntries(0 To 255) As RASENTRYNAME95
    Dim lCount As Long
    Dim sEntry As String

    aDUNEntries(0).dwSize = LenB(aDUNEntries(0)) '264

    lBufferSize = (UBound(aDUNEntries) - LBound(aDUNEntries) + 1) *
aDUNEntries(0).dwSize

    l = RasEnumEntries(vbNullString, vbNullString, aDUNEntries(0), lBufferSize,
lCount)

    For l = 0 To lCount - 1
        sEntry = StrConv(aDUNEntries(l).szEntryName(), vbUnicode)

        lbAny.AddItem Left$(sEntry, InStr(sEntry, vbNullChar) - 1)
    Next

    If (lbAny.ListCount > 0) Then
        lbAny.ListIndex = 0
    End If
End Sub



Tue, 28 May 2002 03:00:00 GMT  
 E-mail & Modem Internet Conection Detection
Hi,

I couldn't locate the thread so I'm posting a new message with
the right subject. Don't start howling.

Regulars here know I'm working on some TAPI/RAS stuff these days.
After posting the previous message to this thread I did some
digging in MSDN and found this gem (?!) hidden away. I was using
the Search tab and it took more digging than I'd have expected.

        SAMPLE: Using Win32 RAS Functions from Visual Basic 4.0 32-bit
        Last reviewed: September 17, 1997
        Article ID: Q150948  
        4.00    | 4.00

        WINDOWS | WINDOWS NT kbprg kbfile kbhowto
        The information in this article applies to:

        Standard, Professional, and Enterprise Editions of Microsoft
        Visual Basic, 32-bit only, for Windows, version 4.0

For some reason, the associated sample (wth an automation server and
client) is available for download only from the MS web-site. There's
a link that works. (Small mercies.)


wondered if one has to handle Win9X vs WinNT. The above sample claims
to do it.

--
MikeC

Please reply to the group.



Thu, 30 May 2002 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. how to detect the internet conection (modem dial-up)

2. Internet Conection from VB5

3. Internet conection from VB5

4. Help, how i can to do internet conection????

5. internet mail & microsoft exchange

6. Carrier detection - modems

7. Modem Status Detection - HOW?

8. Modem port detection from vb4

9. Modem Detection

10. network & modem to modem game using VB

11. Read all mails of Internet Mail

12. Read all mails of Internet Mail

 

 
Powered by phpBB® Forum Software