|
-
Feb 16th, 2010, 02:13 PM
#1
Thread Starter
New Member
[RESOLVED] Use Tls/SSl in vb6
hello!
Well, i have made a simple program to send mail, i made the same program im vb.net and eveything was fine, BUT.... in vb i facing a problem, "Must Issue a STARTTLS command first".
I'm using a custo socket to send my email, so i don't know how to make a procedure to use SSl\TLS.
in Vb.net i have used "System.Net.Mail" and this already have ssl protocol. I just need to set it to true....
So i ask... How to create a procedure or something like to VB6?
-
Feb 16th, 2010, 03:32 PM
#2
Re: Use Tls/SSl in vb6
you can use ssl with cdo.message in vb6
vb Code:
set mymail = createobject("cdo.message")
many examples in this forum for sending to gmail, (uses ssl)
or check out
http://www.planet-source-code.com/vb...43694&lngWId=1
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
-
Feb 16th, 2010, 08:14 PM
#3
Thread Starter
New Member
Re: Use Tls/SSl in vb6
 Originally Posted by westconn1
cdo.messages didn't worked, i have already tryed ...
I donwloaded that link and i'm trying to integrate to my app... But i had a brainstorm... I don't know if this is possible, so help me...
Could i save all procedures from .net (that involves SSL) in a DLL? then make my app read this DLL???
I need to advice you... I'm a begginer in VB6... I can make great programs in .Net, but i never tryed VB6 before, i'm lil' lost...
-
Feb 16th, 2010, 09:09 PM
#4
Re: Use Tls/SSl in vb6
that should work
i don't use .net, but vb6 dlls are easy to use
i don't know why cdo will not work for you, i have used with success
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
-
Feb 16th, 2010, 09:26 PM
#5
Thread Starter
New Member
Re: Use Tls/SSl in vb6
DAmn it!!! No way, i can't... I'm almost giving up!
I have read every line from that source and i tryed a lot of things an nothing worked... Can u explain what f... is SSL?
i was thinking that i should get my pass, use ssl procedure to encrypt the pass then send the encrypted pass to gmail, isn't?
I just don't know, no more ideas, just hope...
HHEELLPP!!!!
Let me explain better...
My program is like a Backup tool...
Everyday in the end of day it should send to my email a simple mail, and attach a file DailySells.txt)
This file contains all sells in the day i have donne... So if someday my HD "BlowsUp" i'll have all backups saveds...
I was thnk another possibiliy, send to an email that dont requires SSL, but i don't know one ...
-
Feb 17th, 2010, 01:35 AM
#6
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:
Set objmessage = CreateObject("CDO.Message") objmessage.Subject = "Example CDO Message" objmessage.To = "me" ' sent to myself, not at gmail objmessage.TextBody = "This is some sample message text." objmessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Name or IP of Remote SMTP Server 'Type of authentication, NONE, Basic (Base64 encoded), NTLM objmessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'Your UserID on the SMTP server objmessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "usernm" 'Your password on the SMTP server objmessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "pass" objmessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com" 'Server port (typically 25) objmessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465 'Use SSL for the connection (False or True) objmessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1 'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server) objmessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30 objmessage.Configuration.Fields.Update objmessage.Send 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
-
Feb 17th, 2010, 02:22 AM
#7
Thread Starter
New Member
Re: Use Tls/SSl in vb6
 Originally Posted by westconn1
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:
Set objmessage = CreateObject("CDO.Message")
objmessage.Subject = "Example CDO Message"
objmessage.To = "me" ' sent to myself, not at gmail
objmessage.TextBody = "This is some sample message text."
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
'Name or IP of Remote SMTP Server
'Type of authentication, NONE, Basic (Base64 encoded), NTLM
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
'Your UserID on the SMTP server
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusername") = "usernm"
'Your password on the SMTP server
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "pass"
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.gmail.com"
'Server port (typically 25)
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 465
'Use SSL for the connection (False or True)
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = 1
'Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objmessage.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30
objmessage.Configuration.Fields.Update
objmessage.Send
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' ...
-
Feb 17th, 2010, 02:29 AM
#8
Re: Use Tls/SSl in vb6
cdo is installed in xp and vista, win 9x may need it installed
no socket is required to use cdo
what socket are you referring to? winsock control? if so it would need to be distributed with your application
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
-
Feb 17th, 2010, 03:13 AM
#9
Thread Starter
New Member
Re: Use Tls/SSl in vb6
Ok, i just think to use In My Xp and some Win7 Computers, anyway, if someday i need to use in a 9x? Should i install CDO there? (Just Curiosity)
And the socket i'm meanin is a custom socket ...
-
Feb 17th, 2010, 02:05 PM
#10
Thread Starter
New Member
Re: Use Tls/SSl in vb6
How do i mark it as solved?
-
Feb 17th, 2010, 02:34 PM
#11
Re: Use Tls/SSl in vb6
You can do it by clicking on "Thread tools" just above the first post in this thread, then "Mark thread resolved". (like various other features of this site, you need JavaScript enabled in your browser for this to work).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|