在我从串口监视器读取的下面的代码中,我需要使用javamail的信息。有什么方法可以提取要放在java邮件中的数据吗?
public synchronized void serialEvent(SerialPortEvent oEvent) {
if (oEvent.getEventType() == SerialPortEvent.DATA_AVAILABLE) {
try {
String inputLine=input.readLine();
String[] parts = inputLine.split(",");
String part1 = parts[0];
String part2 = parts[1];
String part3 = parts[2];
String part4 = parts[3];
part12User.usePart1Part2(part1,part2,part3,part4);
} catch (Exception e) {
System.err.println(e.toString());
}
}
javamail代码体:
public void createEmailMessage() throws AddressException, //generate email.
MessagingException {
String[] toEmails = { "*******@gmail.com" };
String emailSubject = "Speed Violation Summon Issued";
String emailBody = ""; //data to be used here
提前致谢。