|
-
Feb 17th, 2010, 01:35 AM
#1
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
#2
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' ...
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
|