在建立到smtp.gmail.com的TLS连接时出错

时间:2015-06-17 09:52:15

标签: c++ email ssl openssl

我试图用C ++代码连接到smtp.gmail.com,我想我需要openSSL。我安装它并使用命令行

成功连接到服务器

CAST([s].[ UnitCost ] AS float) CAST([s].[Minimum Stock] AS float)

但是在代码中建立连接时遇到了麻烦,请参阅代码的最后几句话。

有人可以帮忙吗?

String[] expected = new String[10];
    //{"Acapulco","Frankfurt","London","New York","Paris","Portland","San Francisco","Seattle","Sydney","Zurich"};
    expected[0] = "Acapulco";
    expected[1] = "Frankfurt";
    expected[2] = "London";
    expected[3] = "New York";
    expected[4] = "Paris";
    expected[5] = "Portland";
    expected[6] = "San Francisco";
    expected[7] = "Seattle";
    expected[8] = "Sydney";
    expected[9] = "Zurich";

    List<WebElement> allOptions = driver.findElements(By.name("fromPort"));

 // match the fromPort list value against the expected Array
    for (int i = 0  ; i < (expected.length); i++) {

         String optionValue = allOptions.get(i).getAttribute("value");

         if (optionValue.equals(expected[i])) {
             System.out.println("PASSED on: " + optionValue + " we had: "+ expected[i] );
         } 

         else {
             System.out.println("FAILED on: " + optionValue + " we expected: " + expected[i]);
         }
 }
    //close Firefox
    driver.close();

0 个答案:

没有答案