0
我得到一個內部服務器異常獲取郵件信息,同時使用lutung的Java API的mandrill。這是我的代碼。如何獲取Mandrill java api發送的郵件狀態?
public MandrillMessageInfo getMessageInfo(String id) {
MandrillApi mandrillApi = new MandrillApi("Your api key");
MandrillMessageInfo info = null;
try {
info = mandrillApi.messages().info(id);
log.debug("Message status-> Email {}, state: {}, timeOfSent: {} ", info.getEmail() ,info.getState(), TimeUtil.getLocalTimeString(info.getTs()));
} catch (Exception e) {
log.debug("Exception occurs while getting message info for id: {}, exception is: {} ", id, e.getMessage());
throw new MailServiceException(ErrorCodes.ERROR_INTERNAL_SERVER_ERROR, ErrorCodes.ERROR_MESSAGE_INTERNAL_SERVER_ERROR);
}
return info;
}
它看起來像你自己拋出內部服務器異常? – Xiao
是的。但** info()**方法,我已經調用拋出** MandrillApiError **異常。我的問題是,我如何獲得有關發送郵件的信息? –