Results 1 to 18 of 18

Thread: quick email

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Location
    England
    Posts
    242

    quick email

    i have 4 text boxes:
    txtname
    txtemail
    txtbugname
    txtbug

    and a send button:
    cmdsend

    i wanna know the code (if anyone knows it) to send the info in these to an email address of my choice instantly, not making anything pop-up or show anything on screen.
    all i need is this:
    subject: "Bug report"
    to: "[email protected]
    text in the email: txtname.Text, txtemail.Text, txtbugname.Text, txtbug.Text

    i want one as simple as possible that can do all this.
    Lpeek

  2. #2

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Location
    England
    Posts
    242
    what controlls do i need? it says something about Active X
    Lpeek

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by lpeek
    what controlls do i need? it says something about Active X
    Which one , I never run them ?

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Location
    England
    Posts
    242
    the second link. it says something like "Active X cant create the object"
    Lpeek

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    You need SMTP . See if this would help you http://www.andreavb.com/forum/viewtopic.php?TopicID=513 .

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Location
    England
    Posts
    242
    how do i know if ive got that?
    Lpeek

  8. #8
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    I believe it's winsocket control . I'm not sure about it in VB6 but in VB.NET we use SSL to send emails coz it requires identification and such stuff .

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Location
    England
    Posts
    242
    so i should just add a winsock control?
    Lpeek

  10. #10
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by lpeek
    so i should just add a winsock control?
    Yes , I guess .

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Location
    England
    Posts
    242
    i just done that and it does the same thing. its something to do with this line:
    Set Mailer = CreateObject("Geocel.Mailer")
    it cant create the object Geocel.Mailer i think
    Lpeek

  12. #12
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Hmm , did you set winsocket name as "Mailer" ??

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Location
    England
    Posts
    242
    now it says invalid use of property over the bit that says "Mailer" in the first line of code (the bit in bold in the code below):
    Set Mailer = CreateObject("Geocel.Mailer")

    here is my full code:
    VB Code:
    1. Private Sub cmdsend_Click()
    2.  Set Mailer = CreateObject("Geocel.Mailer")
    3.  
    4.  Mailer.AddServer "mail", 25
    5.    
    6.  Mailer.FromAddress = txtemail.Text
    7.  Mailer.FromName = txtname.Text
    8.  
    9.  Mailer.AddRecipient "[email protected]", "AEE Staff"
    10.  
    11.  Mailer.Subject = "The JukeBox 2 Bug Report"
    12.  
    13.  Mailer.Body = "Bug Name: " & txtbugname.Text & "" & vbCrLf & _
    14.         "Bug Description: " & txtbug.Text & "" & vbCrLf
    15.  
    16.  bSuccess = Mailer.Send()
    17.  
    18.  If bSuccess = False Then
    19.     If Mailer.Queued = False Then
    20.       MsgBox ("Could not send message. failed to queue!")
    21.     Else
    22.       MsgBox ("Could not send message. the server is queued!")
    23.     End If
    24.     Else
    25.       MsgBox ("Bug Report Sent Successfully!")
    26.     End If
    27. End Sub
    Lpeek

  14. #14
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    You should start first with this line of code :
    VB Code:
    1. Dim Mailer As Winsock
    and then
    VB Code:
    1. Set Mailer = CreateObject("Geocel.Mailer")

  15. #15

    Thread Starter
    Addicted Member
    Join Date
    Nov 2002
    Location
    England
    Posts
    242
    well that bit works, but now it goes through these bits:
    VB Code:
    1. Mailer.AddServer "mail", 25
    2.    
    3.  Mailer.FromAddress = txtemail.Text
    4.  Mailer.FromName = txtname.Text
    5.  
    6.  Mailer.AddRecipient "[email protected]", "AEE Staff"
    7.  
    8.  Mailer.Subject = "The JukeBox 2 Bug Report"
    9.  
    10.  Mailer.Body = "Bug Name: " & txtbugname.Text & "" & vbCrLf & _
    11.         "Bug Description: " & txtbug.Text & "" & vbCrLf
    saying that "Method or Data member not found"
    Lpeek

  16. #16
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Yes , right . It seems the code referes to custom control not the one we're working with . anyways , don't worry you still have chance to get it work . Try these links ...http://www.vbcode.com/asp/showsn.asp?theID=619
    http://www.vbcode.com/asp/showsn.asp?theID=1794
    if didn't help then go here http://www.vbcode.com and search with "smtp" and try other links . I'm dead tired I should to sleeep

  17. #17
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    There is another thread here talks about sending emails in VB .(in case you've not seen it).

  18. #18
    Hyperactive Member
    Join Date
    May 2001
    Posts
    414
    Here's an example that works great using Winsock and your email sever.

    Bug Report tool

    http://www.planet-source-code.com/vb...44441&lngWId=1

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