Results 1 to 20 of 20

Thread: SMTP sendmail for vb6.0

  1. #1

    Thread Starter
    Hyperactive Member wizkid's Avatar
    Join Date
    Dec 2005
    Location
    uk
    Posts
    405

    SMTP sendmail for vb6.0

    I am trying the sendmail program in vb6.
    which is in freevbcode.com
    Fo that i am trying to include the "SMTP sendmail for vb6.0 reference."But
    I can't find the reference "SMTP sendmail for vb6.0" in project reference
    What's the problem

  2. #2
    Frenzied Member
    Join Date
    Nov 2001
    Location
    Mass USA
    Posts
    1,674

    Re: SMTP sendmail for vb6.0

    I think you are supposed to put the .dll in your system32 folder then go to references and browse to it... not sure tho, it's been a while.

  3. #3
    Member
    Join Date
    Sep 2006
    Posts
    40

    Re: SMTP sendmail for vb6.0

    You need to add the vbSendMail project to your project and create a project group then the vbSendMail will appear in the ref list

  4. #4

    Thread Starter
    Hyperactive Member wizkid's Avatar
    Join Date
    Dec 2005
    Location
    uk
    Posts
    405

    Re: SMTP sendmail for vb6.0

    already there is file sendmail.dll in system32.
    So try to add that file in reference(browse..)
    But i can't add the dll.
    error:
    Can't add a reference to the specified file?

  5. #5

    Thread Starter
    Hyperactive Member wizkid's Avatar
    Join Date
    Dec 2005
    Location
    uk
    Posts
    405

    Re: SMTP sendmail for vb6.0

    I copied the sendmail.dll in local folder (not in System32)
    and i added as a reference in my project.
    Now it is fine.
    I am really new for this sendmail thing
    Can you please tell me is this alright?
    I tried like this...No result..nothing

    Any changes,Please Explain me..
    VB Code:
    1. Private WithEvents poSendMail As vbSendMail.clsSendMail
    2. Private Sub Command1_Click()
    3. 'Module Level Declaration (WithEvents optional but recommended)
    4.  
    5.   'poSendMail.SMTPHost = "gmail.com"
    6.     poSendMail.SMTPHost = "gmail.com"
    7.     poSendMail.From = "some@gmail.com"
    8.     poSendMail.FromDisplayName = "some"
    9.  
    10.     poSendMail.Recipient = "some1@gmail.com"
    11.     poSendMail.RecipientDisplayName = "xx"
    12.     poSendMail.Subject = "xy"
    13.  
    14.     poSendMail.Message = "thisMailMessage"
    15.  
    16.     poSendMail.Send
    17.  
    18. End Sub
    19.  
    20. Private Sub Form_Load()
    21.  
    22. ' initialize the component
    23. Set poSendMail = New clsSendMail
    24.  
    25. End Sub

  6. #6
    Member
    Join Date
    Sep 2006
    Posts
    40

    Re: SMTP sendmail for vb6.0

    VB Code:
    1. Private Sub cmdSend_Click()
    2. On Error GoTo ErrorHdl
    3.     lstStatus.Clear
    4.     Me.MousePointer = vbHourglass
    5.     'MsgBox poSendMail.GetIPAddress("internet.greenafrica.co.za")
    6.     poSendMail.SMTPHost = poSendMail.MXQuery("10.11.1.4")
    7.     'poSendMail.r
    8.     poSendMail.From = Replace(Trim(txtFrom), vbCrLf, "")
    9.     poSendMail.CcRecipient = Replace(Trim(txtCc), vbCrLf, "")
    10.     poSendMail.Recipient = Replace(Trim(txtTo.Text), vbCrLf, "")
    11.     poSendMail.RecipientDisplayName = Trim(txtTo.Text)
    12.     poSendMail.ReplyToAddress = Trim(txtFrom)
    13.     poSendMail.Subject = Trim(txtSubject.Text)
    14.     'poSendMail.Attachment = txtFileName.Text 'attached file name
    15.     poSendMail.Message = txtBody.Text
    16.     poSendMail.Send
    17.     Set poSendMail = Nothing
    18.     Me.MousePointer = vbNormal
    19.     If boolMail = True Then
    20.         Unload Me
    21.     Else
    22.         'Reset Mail class
    23.         Set poSendMail = New clsSendMail
    24.     End If
    25.     Exit Sub
    26. ErrorHdl:
    27.     MsgBox Err.Description
    28. End Sub

  7. #7

    Thread Starter
    Hyperactive Member wizkid's Avatar
    Join Date
    Dec 2005
    Location
    uk
    Posts
    405

    Re: SMTP sendmail for vb6.0

    Sorry.
    It is not working

  8. #8
    Member
    Join Date
    Sep 2006
    Posts
    40

    Re: SMTP sendmail for vb6.0

    upload it, its not difficult

  9. #9
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: SMTP sendmail for vb6.0

    poSendMail.SMTPHost = poSendMail.MXQuery("10.11.1.4") will only work if you're on a LAN and have an SMTP host at 10.11.1.4. You may be the only one in the entire world with an SMTP host at that address.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  10. #10

    Thread Starter
    Hyperactive Member wizkid's Avatar
    Join Date
    Dec 2005
    Location
    uk
    Posts
    405

    Re: SMTP sendmail for vb6.0

    I tried with different options.
    Using this small program i want to send a mail to gmail.

    I changed like this?

    VB Code:
    1. On Error GoTo ErrorHdl
    2.     Private Sub cmdSend_Click()
    3.     Me.MousePointer = vbHourglass
    4.     MsgBox poSendMail.GetIPAddress("www.gmail.com")
    5.     Dim s As String
    6.     s = poSendMail.GetIPAddress("www.gmail.com")
    7.      poSendMail.SMTPHost = Trim(s)
    8.  
    9.     poSendMail.From = Replace(Trim(txtFrom), vbCrLf, "")
    10.  
    11.     poSendMail.Recipient = Replace(Trim(txtTo.Text), vbCrLf, "")
    12.     poSendMail.RecipientDisplayName = Trim(txtTo.Text)
    13.     poSendMail.ReplyToAddress = Trim(txtFrom)
    14.     poSendMail.Subject = Trim(txtSubject.Text)
    15.      
    16.     poSendMail.Send
    17.     Set poSendMail = Nothing
    18.     Me.MousePointer = vbNormal
    19.     If boolMail = True Then
    20.         Unload Me
    21.     Else
    22.         'Reset Mail class
    23.         Set poSendMail = New clsSendMail
    24.     End If
    25.     Exit Sub
    26. ErrorHdl:
    27.     MsgBox Err.Description '
    28. End Sub
    while executing this program it is waiting a few seconds at poSendMail.send
    But no result

    you have given me this address .10.11.1.4 What is this??
    Thanks for the reply

  11. #11
    Member
    Join Date
    Sep 2006
    Posts
    40

    Re: SMTP sendmail for vb6.0

    You can leave the ip out then it gets the default smtp server I just copied my code that works.

  12. #12

    Thread Starter
    Hyperactive Member wizkid's Avatar
    Join Date
    Dec 2005
    Location
    uk
    Posts
    405

    Re: SMTP sendmail for vb6.0

    if i take ip out then what may be the the default smtp server

  13. #13
    Member
    Join Date
    Sep 2006
    Posts
    40

    Re: SMTP sendmail for vb6.0

    do you have a username & password for www.gmail.com

  14. #14

    Thread Starter
    Hyperactive Member wizkid's Avatar
    Join Date
    Dec 2005
    Location
    uk
    Posts
    405

    Re: SMTP sendmail for vb6.0

    of course,I have

  15. #15
    Member
    Join Date
    Sep 2006
    Posts
    40

    Re: SMTP sendmail for vb6.0

    I cant create a GMail account from South-Africa, try to set the username and password options.

  16. #16
    Addicted Member
    Join Date
    Sep 2003
    Posts
    160

    Re: SMTP sendmail for vb6.0

    gmail use SSL smtp,
    does your component support ssl?

  17. #17

    Thread Starter
    Hyperactive Member wizkid's Avatar
    Join Date
    Dec 2005
    Location
    uk
    Posts
    405

    Re: SMTP sendmail for vb6.0

    sorry.really i am zero in this program
    what is ssl?
    thanks

  18. #18
    Frenzied Member the182guy's Avatar
    Join Date
    Nov 2005
    Location
    Cheshire, UK
    Posts
    1,473

    Re: SMTP sendmail for vb6.0

    SSL is a strong encryption system used to send data across the internet. You will have to encrypt your data before sending, and decrypt upon receiving according to the SSL specification

    http://www.webopedia.com/TERM/S/SSL.html
    Chris

  19. #19
    New Member
    Join Date
    Feb 2009
    Posts
    4

    Re: SMTP sendmail for vb6.0

    Green Africa : Can u help me regarding your VB Send Dll? Winsock .connect method always returns sckError constant(9). I have provide gmail username along with passowrd and also use the GetIPAddress method and pass "www.gmail.com".

  20. #20
    PowerPoster isnoend07's Avatar
    Join Date
    Feb 2007
    Posts
    3,237

    Re: SMTP sendmail for vb6.0

    I use googles smtp server in my vb program
    Requirements:
    smtp.server = smtp.gmail.com
    Requires authenication = Yes
    Requires SSL = yes
    Port # = 25
    Username = yes
    Password = yes
    Waiting for a full featured smart phone with out marrying a provider
    Go Android
    Go raiders

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