32 bit SSL SMTP
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: 32 bit SSL SMTP
I tried this code last night, PB5.11, worked like a charm. Tonight, it fails - "Bad argument, parameter 3". Have not changed any of the parameters, so does anyone know what is happening?
Edit: To be absolutely sure, I copied and pasted the code again. The only things requiring change are the mailFrom, userName, password, mailTo and an extra #CRLF$ to seperate the Subject line from the body. Still no-go with the parameter 3 error.
Edit: To be absolutely sure, I copied and pasted the code again. The only things requiring change are the mailFrom, userName, password, mailTo and an extra #CRLF$ to seperate the Subject line from the body. Still no-go with the parameter 3 error.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
- RichAlgeni
- Addict
- Posts: 935
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: 32 bit SSL SMTP
Can you trap out where in the code the error is coming from?
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: 32 bit SSL SMTP
I'm working on that now - decided to leave it for a while as sometimes the most obvious things are not spotted with a tired brain. 

IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: 32 bit SSL SMTP
It fails when adding the Server Name.
CryptSetAttributeString() 3rd parameter is *mailHost, which (correctly) = "smtp.gmail.com" - Checked using PeekS(*mailHost)
Oh, there it is, right under my nose - compiler set to Unicode. Works fine non-unicode.......
CryptSetAttributeString() 3rd parameter is *mailHost, which (correctly) = "smtp.gmail.com" - Checked using PeekS(*mailHost)
Oh, there it is, right under my nose - compiler set to Unicode. Works fine non-unicode.......
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: 32 bit SSL SMTP
....so, having trouble getting it to work with unicode - is it the case that the cryptlib32.dll does not accept unicode strings?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
- RichAlgeni
- Addict
- Posts: 935
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: 32 bit SSL SMTP
Can you use ascii for everything but the body of the email, then switch to unicode? Not sure if that's possible.
- RichAlgeni
- Addict
- Posts: 935
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: 32 bit SSL SMTP
Or is it possible that unicode is just used as an attachment???
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: 32 bit SSL SMTP
Hi RichAlgeni

That might well be possible I think, but the email facility in my app is only a small part of the functionality, all of which is Unicode. So, got to put my thinking hat on again ~difficult because the UK has a heatwave on and we are just not made for temperatures above 10 degreesCan you use ascii for everything but the body of the email, then switch to unicode? Not sure if that's possible.

IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: 32 bit SSL SMTP
Well, I can "Asciifi" the User info and server handshakes/error messages with tons of Pokes and Peeks - but whilst wading through the changes, I realised that it would just not be good enough because Users could have Unicode Names/Passwords/Subject/Body, and things like foreign language accents would be lost - or in the case of Chinese characters for example, everything would be lost. Gmail supports Unicode, my app is in Unicode, so I must find a way of using the Gmail server in Unicode. 
Edit: Well in fact, looks as though it's possible to do it without encryption of everything (so no cryptlib), which is unnecessary in my case, so more experiments underway.

Edit: Well in fact, looks as though it's possible to do it without encryption of everything (so no cryptlib), which is unnecessary in my case, so more experiments underway.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
- RichAlgeni
- Addict
- Posts: 935
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: 32 bit SSL SMTP
Here's what I found doing a search online:
The default environment for (non-CE) Windows is ASCII. If you want to use it with Unicode, you'd have to also build the DLL as a Unicode DLL (via the UNICODE_CHARS define). I'd recommend giving this a name other than cl32.dll to avoid confusion over using the incorrect DLL.
- RichAlgeni
- Addict
- Posts: 935
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: 32 bit SSL SMTP
Here is the complete zipped download, if someone with a C compiler would like to take on creating the dll's with Unicode.
http://www.rca2.com/dlls/cl342.zip
Maybe they could be named unic_cl32.dll and unic_cl64.dll?
http://www.rca2.com/dlls/cl342.zip
Maybe they could be named unic_cl32.dll and unic_cl64.dll?
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: 32 bit SSL SMTP
Google no longer accepts any un-encrypted email (plain text), which is a pain - not every email needs Fort Knox security.
I had hoped that cryptlib would have Unicode versions of each command alongside the ASCII ones.
However, it seems things have changed. The lib is of course vast, what it can do for email is only a small part of the entire lib - but if you want to use cryptlib for your commercial app, you have to buy the whole lib
Even if your app is not commercial, you must have a cryptlib license: http://www.cryptlib.com/downloads/crypt ... e-2010.pdf
I had hoped that cryptlib would have Unicode versions of each command alongside the ASCII ones.
However, it seems things have changed. The lib is of course vast, what it can do for email is only a small part of the entire lib - but if you want to use cryptlib for your commercial app, you have to buy the whole lib

Even if your app is not commercial, you must have a cryptlib license: http://www.cryptlib.com/downloads/crypt ... e-2010.pdf
Sales team? Sounds like it is going to be expensive if you only want to use it for email from your app.........Licensing and Pricing
cryptlib is distributed under a dual license that allows free, open/source use under a GPL/like license (aka the "Sleepycat"license) and closed/source use under a standard commercial license. In addition, cryptlib is often free for use in low/cost, non/open/source applications such as shareware, and for personal and research use.
NB: All cryptlib users must have a valid software license. Please contact the cryptlib sales team for further details, and a license estimate.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
- RichAlgeni
- Addict
- Posts: 935
- Joined: Wed Sep 22, 2010 1:50 am
- Location: Bradenton, FL
Re: 32 bit SSL SMTP
Would it be recommended to move to OpenSSL?
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: 32 bit SSL SMTP
The license for OpenSSL is extremely fair.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: 32 bit SSL SMTP
So far as I can tell at the moment, openssl can be used in a similar way to PB's Network lib, so it's easy to use. However, it's huge, so a lot of work looks to be needed to separate the wheat from the chaff.
Edit: The documentation could be better!
Edit: The documentation could be better!
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.