We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying code as follows:
try (Retriever retriever = new Retriever(mailServer.getSmtps())) { Message[] messages = retriever.getMessages(email, password); if (messages != null) { for (Message m : messages) { TestCaseUtils.originalSystemOut.println("Subject: " + m.getSubject()); TestCaseUtils.originalSystemOut.println("Sent Date: " + m.getSentDate()); TestCaseUtils.originalSystemOut.println("From: " + Arrays.toString(m.getFrom())); TestCaseUtils.originalSystemOut.println("Subject: " + m.getContent()); } } else { TestCaseUtils.originalSystemOut.println("No emails for: " + email); } }
Gives me an error on Message[] messages = retriever.getMessages(email, password); about invalid provider.
Message[] messages = retriever.getMessages(email, password);
I create the server as suggested:
Security.setProperty("ssl.SocketFactory.provider", DummySSLSocketFactory.class.getName()); mailServer = new GreenMail(ServerSetupTest.SMTPS); mailServer.start();
Receiving the messages li below gives no issues:
Message[] messages = mailServer.getReceivedMessages();
The text was updated successfully, but these errors were encountered:
Retriever works by using the mail protocols (IMAP or POP3) for retrieving mails, and therefore works remotely.
A mailServer.getReceivedMessages() directly accesses the server instance (and won't work remotely).
mailServer.getReceivedMessages()
Regarding your example:
mailServer = new GreenMail(ServerSetupTest.SMTPS_IMAPS);
try (Retriever retriever = new Retriever(mailServer.getImaps()))
Sorry, something went wrong.
f715928
Fixes #243 : Retriever using SMTPS TLS
fad2bee
Throw exception if server is not IMAP or POP3
marcelmay
No branches or pull requests
Trying code as follows:
Gives me an error on
Message[] messages = retriever.getMessages(email, password);
about invalid provider.I create the server as suggested:
Receiving the messages li below gives no issues:
Message[] messages = mailServer.getReceivedMessages();
The text was updated successfully, but these errors were encountered: