Author |
|
alip Newbie
Joined: 21 November 2007 Location: Russian Federation
Online Status: Offline Posts: 3
|
Posted: 21 November 2007 at 12:37am | IP Logged
|
|
|
Hi,
I encountered with a problem accessing gmail SMTP service. I set up SSL, username, password, etc, but i can't connect with the server!
The log shows that there is some SSL error:
11:12:18 [Connecting to server smtp.gmail.com at port 587 using default domain]
11:12:19 [Initiating SSL Connection]
11:12:19 [Error: SSL Init Failed]
11:12:19 [Error: Connection failure]
GMail POP3 works fine.
Here is the C++ code I use to connect:
smtp.SetAuthMethod(1); // i also tried codes 0, 1, 2, 3
smtp.SetUserName(m_strSMTPName);
smtp.SetPassword(m_strSMTPPassword);
smtp.SetPortNumber(587);
ssl.SetUseStartTLS(TRUE);
smtp.SetRefSsl(ssl);
smtp.Connect(); // return error
What do I do wrong?
Is it possible to connect to gmail via MailBee SMTP?
Best Regards
Andrew
|
Back to Top |
|
|
alip Newbie
Joined: 21 November 2007 Location: Russian Federation
Online Status: Offline Posts: 3
|
Posted: 21 November 2007 at 12:52am | IP Logged
|
|
|
Update:
SSLSpecificError returns 0x80090308
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 21 November 2007 at 6:51am | IP Logged
|
|
|
I think this is because you're setting ssl.SetUseStartTLS(TRUE). C++ is a complicated thing where TRUE is not True.
TRUE is 1, while ActiveX's True is VARIANT_TRUE in C++, and it's numeric value is -1.
Regards,
Alex
|
Back to Top |
|
|
alip Newbie
Joined: 21 November 2007 Location: Russian Federation
Online Status: Offline Posts: 3
|
Posted: 21 November 2007 at 9:55am | IP Logged
|
|
|
Thanks for the reply.
Unfortunately VARIANT_TRUE doesn't work too.
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 21 November 2007 at 10:17am | IP Logged
|
|
|
Try to upgrade to the latest version of MailBee.dll.
I just checked with MailBee.dll 5.5.0.114 and it works fine for me. Even with TRUE (this is because we added checks which accept both -1 and 1 as TRUE inside the component).
Code:
ISMTP oMailer;
ISSL oSSL;
if (oMailer.CreateDispatch("MailBee.SMTP"))
{
oMailer.SetLicenseKey("your key here");
oMailer.SetServerName("smtp.gmail.com");
oMailer.SetPortNumber(587);
oMailer.SetLogFilePath("C:\\smtp_log.txt");
oMailer.SetEnableLogging(-1);
if (oSSL.CreateDispatch("MailBee.SSL"))
{
oSSL.SetLicenseKey("your key here");
oSSL.SetUseStartTLS(TRUE);
oMailer.SetRefSsl(oSSL);
}
BOOL b1 = oMailer.Connect();
BOOL b2 = oMailer.Disconnect();
}
|
|
|
Regards,
Alex
|
Back to Top |
|
|