Results 1 to 5 of 5

Thread: Emailing in VB6?

  1. #1

    Thread Starter
    Banned
    Join Date
    Aug 2007
    Posts
    17

    Emailing in VB6?

    I had a friend, he could send me an email from an email he doesn't have. (ex: [email protected] or anything else.) He could send me any email too. He showed me the program, and let me use it, it was made in vb, but he would never give me the source. How Can I do this with vb6?

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Emailing in VB6?

    i get enough spam already thanx
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Banned
    Join Date
    Aug 2007
    Posts
    17

    Re: Emailing in VB6?

    Very helpful comment. This isn't for spam.

  4. #4
    Lively Member
    Join Date
    Oct 2005
    Posts
    90

    Re: Emailing in VB6?

    If you have a mail server using exchange you could add a reference to:'Microsoft CDO for exchange' then use this code ?

    Code:
    Private Sub Command1_Click() 'send Email
     Dim objMessage
       
    On Error GoTo err:
        Set objMessage = New CDO.Message
        objMessage.Subject = "Test Message"
        objMessage.From = "from.me.com" 'add any text here
        objMessage.To = "to_your.friend.com"
        objMessage.TextBody = "This is a test message"
        
        objMessage.Configuration.Fields.Item _
        ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
        objMessage.Configuration.Fields.Item _
        ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "192.168.26.1" 'enter IP address of your mail server
        objMessage.Configuration.Fields.Item _
        ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
        objMessage.Configuration.Fields.Update
        objMessage.Send
        Set objMessage = Nothing
       
        Exit Sub
    err:
        MsgBox "Error!" & vbNewLine & err.Description
        Exit Sub
    End Sub

  5. #5

    Thread Starter
    Banned
    Join Date
    Aug 2007
    Posts
    17

    Re: Emailing in VB6?

    I don't have a mail server, neither did my friend.

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