我正在尝试通过ses发送电子邮件。使用nodemailer进行了尝试,在相同的ses上可以正常工作,但是不能使用它。现在,当我按照文档使用ses时,它会抛出TypeError。
import java.util.Scanner;
public class res{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String word ="Hello";
int guessedLetters = 0;
//System.out.print(" Word has "+word.length()+" letters ");
//System.out.print(" You have 9 lives left ");
while(guessedLetters<word.length()) {
int lives = 9;
char input = in.nextLine().charAt(0);
lives =livesLeft(lives, word, input, guessedLetters);
//res = resolved(res, word, input, lives);
//Lives
//method to guess
//initial word
//what to do if letter is not correct
//what to do if letter is correct
}
}
public static int livesLeft( int lives, String word, char input, int guessedLetters) {
boolean res = false;
for(int i =0; i<word.length();i++) {
if(input==word.charAt(i)) {
//System.out.print(" Your guessed the " + i + "th letter right");
res = true;
guessedLetters++;
}else {
res =false;
lives--;
}
System.out.print(res+" " + lives + " ");
}
//if res returns false on word.length() many times lives --;
//System.out.print(res+" " + lives + " ");
//System.out.println("You have "+lives+" lives left ");
//System.out.println("You have guessed "+guessedLetters
//+" out of " + word.length() +" letters in the word ");
return lives;
}
public static void printGameState() {
//method to print out How many letters guessed
}
}
错误: TypeError:SES.sendEmail(...)。promise不是函数
节点-v6.16.0 Npm-v3.10.10