All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.icegreen.greenmail.util.UserUtil Maven / Gradle / Ivy

There is a newer version: 2.1.2
Show newest version
package com.icegreen.greenmail.util;

import com.icegreen.greenmail.base.GreenMailOperations;

import jakarta.mail.internet.InternetAddress;

/**
 * Utility for managing users
 */
public final class UserUtil {
    /**
     * No instance
     */
    private UserUtil() {
    }

    /**
     * Create users for the given array of addresses. The passwords will be set to the email addresses.
     *
     * @param greenMail Greenmail instance to create users for
     * @param addresses Addresses
     */
    public static void createUsers(GreenMailOperations greenMail, InternetAddress... addresses) {
        for (InternetAddress address : addresses) {
            greenMail.setUser(address.getAddress(), address.getAddress());
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy