Results 1 to 18 of 18

Thread: VB6.0 - Mail Retrieval

Threaded View

  1. #1

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    VB6.0 - Mail Retrieval

    Hi,

    This example show how easy it is to send an email using smtp in this case via the We Only Do smtp component. Also, attached is the rewrite of my VB6.0 - Office Outlook mail retrieval program.

    vb Code:
    1. Dim WithEvents smtp As wodSmtpCom
    2. Private Sub Form_Load()
    3. Set smtp = New wodSmtpCom
    4.  
    5. smtp.HostName = "smtp.gmail.com"
    6. smtp.Security = SecurityImplicit
    7. smtp.Login = "your email"
    8. smtp.Password = "your password"
    9. smtp.Authentication = AuthLogin
    10. smtp.Blocking = True
    11.  
    12. On Error Resume Next
    13.  
    14. smtp.Connect
    15. smtp.Message.Attach "Attachment"
    16. smtp.Message.Attach "Attachment"
    17. smtp.Message.From = "your email"
    18. smtp.Message.To = "to email"
    19.  
    20. smtp.Message.Subject = "test"
    21. smtp.Message.Text = "testing"
    22.  
    23. smtp.SendMessage
    24.  
    25. smtp.Disconnect
    26. End Sub
    27.  
    28. Private Sub smtp_Disconnected(ByVal ErrorCode As Long, ByVal ErrorText As String)
    29.     Debug.Print "Disconnected: " & ErrorText
    30.     If ErrorCode <> 0 Then
    31.         Debug.Print smtp.Transcript
    32.         End If
    33. End Sub
    34.  
    35. Private Sub smtp_Done(ByVal ErrorCode As Long, ByVal ErrorText As String)
    36. If ErrorCode <> 0 Then
    37.     Debug.Print "Done Event: " & ErrorText
    38.     Else
    39.     Debug.Print "E-mail sent!"
    40.     End If
    41. End Sub

    Edit:

    The attachment contains both the code for smtp and pop functionality.

    Other samples are available from the WeOnlyDo site.

    Note: You need to download the Smtp component in order to use the example.


    Nightwalker
    Attached Files Attached Files
    Last edited by Nightwalker83; Dec 8th, 2011 at 06:04 PM. Reason: Adding more!
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

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