Results 1 to 11 of 11

Thread: [RESOLVED] Use Tls/SSl in vb6

Hybrid View

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

    Re: Use Tls/SSl in vb6

    ssl secure sockets layer
    only required for secure email server
    WHY does cdo not work?

    have you tried sample code from the forum
    vb Code:
    1. Set objmessage = CreateObject("CDO.Message")
    2.       objmessage.Subject = "Example CDO Message"
    3.       objmessage.From = "[email protected]"
    4.       objmessage.To = "me" ' sent to myself, not at gmail
    5.       objmessage.TextBody = "This is some sample message text."
    6.        
    7.        objmessage.Configuration.Fields.Item _
    8.       ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    9.        
    10.       'Name or IP of Remote SMTP Server
    11.        
    12.        
    13.       'Type of authentication, NONE, Basic (Base64 encoded), NTLM
    14.       objmessage.Configuration.Fields.Item _
    15.       ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    16.       'Your UserID on the SMTP server
    17.       objmessage.Configuration.Fields.Item _
    18.       ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "usernm"
    19.        
    20.       'Your password on the SMTP server
    21.        
    22.       objmessage.Configuration.Fields.Item _
    23.       ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "pass"
    24.       objmessage.Configuration.Fields.Item _
    25.       ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
    26.       'Server port (typically 25)
    27.       objmessage.Configuration.Fields.Item _
    28.       ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
    29.       'Use SSL for the connection (False or True)
    30.       objmessage.Configuration.Fields.Item _
    31.       ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
    32.       'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
    33.       objmessage.Configuration.Fields.Item _
    34.       ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
    35.       objmessage.Configuration.Fields.Update
    36.       objmessage.Send
    37.       Set objmessage = Nothing
    change to and from email addresses and username and password
    if you are not using gmail you may need to change port and server
    gmail will not accept some types of attachments and will not allow sender spoofing

    another free server is GMX


    other options, upload to ftp server, using ftp, can have several advantages
    Last edited by westconn1; Feb 17th, 2010 at 01:39 AM.
    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

  2. #2

    Thread Starter
    New Member
    Join Date
    Feb 2010
    Posts
    8

    Thumbs up Re: Use Tls/SSl in vb6

    Quote Originally Posted by westconn1 View Post
    ssl secure sockets layer
    only required for secure email server
    WHY does cdo not work?

    have you tried sample code from the forum
    vb Code:
    1. Set objmessage = CreateObject("CDO.Message")
    2.       objmessage.Subject = "Example CDO Message"
    3.       objmessage.From = "[email protected]"
    4.       objmessage.To = "me" ' sent to myself, not at gmail
    5.       objmessage.TextBody = "This is some sample message text."
    6.        
    7.        objmessage.Configuration.Fields.Item _
    8.       ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    9.        
    10.       'Name or IP of Remote SMTP Server
    11.        
    12.        
    13.       'Type of authentication, NONE, Basic (Base64 encoded), NTLM
    14.       objmessage.Configuration.Fields.Item _
    15.       ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    16.       'Your UserID on the SMTP server
    17.       objmessage.Configuration.Fields.Item _
    18.       ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "usernm"
    19.        
    20.       'Your password on the SMTP server
    21.        
    22.       objmessage.Configuration.Fields.Item _
    23.       ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "pass"
    24.       objmessage.Configuration.Fields.Item _
    25.       ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
    26.       'Server port (typically 25)
    27.       objmessage.Configuration.Fields.Item _
    28.       ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
    29.       'Use SSL for the connection (False or True)
    30.       objmessage.Configuration.Fields.Item _
    31.       ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
    32.       'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
    33.       objmessage.Configuration.Fields.Item _
    34.       ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
    35.       objmessage.Configuration.Fields.Update
    36.       objmessage.Send
    37.       Set objmessage = Nothing
    change to and from email addresses and username and password
    if you are not using gmail you may need to change port and server
    gmail will not accept some types of attachments and will not allow sender spoofing

    another free server is GMX


    other options, upload to ftp server, using ftp, can have several advantages
    I dunno ...

    I already have tryed this and did'n worked before, but now is working , anyway, my program already have an "own" socket, now that i'm using this method means that i can deactivate this socket?
    Another doubt is, will my program now have a dependency? an additional file to be installed in other machines? When i started to create my app, i saw in the internet to use that socket, thus i wouldn't need to use an "ocx" that sometimes is missing in some computers.
    I don't know exactly what i'm talking about, but i hope you can figure what i'm meanin' ...

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