-2

i want to use greenmail as a webapp. is there a way in java to dynamically create user accounts on the greenmail server?

javamail does not contain api for creating users on mail server. is there a rest i can use or anything in java code for dynamically create user accounts on the greenmail server?

really need help here.

Thanks!

oded
  • 9
  • 4
  • OK i know how to create an account dynamically. but know i need to know how to delete the account :) – oded Jun 14 '15 at 16:25

1 Answers1

0

See https://github.com/greenmail-mail-test/greenmail/issues/80 (available in next release > 1.4.1):

You can delete a user via

greenMail.getManagers().getUserManager().deleteUser(user);
Marcel
  • 266
  • 2
  • 5
  • Thanks, This can not be used when using greenmail as a webapp. There is no instance of the greenmail at the java code when running greenmail as a webapp. The way to create users dynamically is by sending an email to a user that does not exist, greenmail automatically creates the user. But I don't know how to delete the user that was created. Is there a way to to retrieve the instance of the web app? – oded Jun 23 '15 at 09:07
  • Or a way to send a request to the server to delete a user? – oded Jun 23 '15 at 09:22