Results 1 to 4 of 4

Thread: E-mailing with VB6

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2001
    Posts
    152

    Exclamation E-mailing with VB6

    how do you send an email to a set address trhough a VB6 EXE? thanks in advance

  2. #2
    If you want to open your e-mail client with an e-mail address already entered, try ShellExecute: http://www.vb-world.net/demos/shellexecute/ (mailto:[email protected] instead of http://www...

    To really send e-mail, http://www.vbsquare.com/internet/pop/

  3. #3
    AutoBot
    Guest
    This is assuming you have a label named lblMail

    VB Code:
    1. 'in a form
    2.  
    3. Private Sub lblMail_Click()
    4.    
    5.     On Error Resume Next
    6.  
    7.     ShellDocument "mailto:[email protected]"
    8.  
    9. End Sub

    VB Code:
    1. ' in a module
    2.  
    3. Option Explicit
    4.  
    5. Public Declare Function ShellExecute& Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long)
    6. Public Enum StartWindowState
    7.     START_HIDDEN = 0
    8.     START_NORMAL = 4
    9.     START_MINIMIZED = 2
    10.     START_MAXIMIZED = 3
    11. End Enum
    12.  
    13. Public Function ShellDocument(sDocName As String, _
    14.        Optional ByVal Action As String = "Open", _
    15.        Optional ByVal Parameters As String = vbNullString, _
    16.        Optional ByVal Directory As String = vbNullString, _
    17.        Optional ByVal WindowState As StartWindowState) As Boolean
    18.  
    19.     Dim Response
    20.     Response = ShellExecute(&O0, Action, sDocName, Parameters, Directory, WindowState)
    21.  
    22.     Select Case Response
    23.  
    24.         Case Is < 33
    25.             ShellDocument = False
    26.  
    27.         Case Else
    28.             ShellDocument = True
    29.  
    30.     End Select
    31.  
    32. End Function

  4. #4
    Lively Member
    Join Date
    Aug 2001
    Location
    Brugge
    Posts
    102
    or you can use the cdonts component
    Greetz Matje

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width