Sends an email to the user.<p>

@param newUser is the user new?
346684
protected static void sendMail(
        CmsObject cms,
        String password,
        CmsUser user,
        boolean newUser,
        boolean changePassword) {

        sendMail(cms, password, user, user.getOuFqn(), newUser, changePassword);
    }
162683
public function sendActivationMail($user)
    {
        if ($user->activated || !$this->shouldSend($user)) {
            return;
        }
        $userToken = $this->createActivation($user);
        //$userToken = User::find($user->id);
        $user->notify(new ConfirmEmailNotification($userToken));
    }
287243
public function sendNewUser(string $email, string $username, string $password): void
	{
		$mail = $this->createMail('newUser');

		$mail->link = $this->link('Cms:Sign:in');
		$mail->username = $username;
		$mail->password = $password;

		$mail->setSubject('cms.mailing.newUser.subject')
			->addTo($email);

		$mail->send();
	}
640875
public void submit(CmsUser user, CmsObject cms, Runnable afterWrite, boolean force) {

        try {
            if (isValid() | force) {
                if (force) {
                    removeValidators();
                }
                m_binder.commit();
                PropertyUtilsBean propUtils = new PropertyUtilsBean();
                for (CmsAccountInfo info : OpenCms.getWorkplaceManager().getAccountInfos()) {
                    boolean editable = (m_editLevel == EditLevel.all)
                        || ((m_editLevel == EditLevel.configured) && info.isEditable());
                    if (editable) {
                        if (info.isAdditionalInfo()) {
                            user.setAdditionalInfo(info.getAddInfoKey(), m_infos.getItemProperty(info).getValue());
                        } else {
                            if (!CmsStringUtil.isEmptyOrWhitespaceOnly(
                                (String)m_infos.getItemProperty(info).getValue())) {
                                propUtils.setProperty(
                                    user,
                                    info.getField().name(),
                                    m_infos.getItemProperty(info).getValue());
                            }
                        }
                    }
                }
                cms.writeUser(user);
                afterWrite.run();
            }
        } catch (CmsException | CommitException | IllegalAccessException | InvocationTargetException
        | NoSuchMethodException e) {
            LOG.error("Unable to commit changes to user..", e);
        }
    }
1297783
public void setUserInfo(String username, String infoName, String value) throws CmsException {

        CmsUser user = m_cms.readUser(username);
        user.setAdditionalInfo(infoName, value);
        m_cms.writeUser(user);
    }
271420
public static void putUser(final String user) {
		if ((user != null) && (0 < user.length())) {
			MDC.put(USER, user);
		}
	}
180978
public static void sendEmail(String email, String subject, String emailBody) {
        Intent emailIntent = new Intent(Intent.ACTION_SEND);
        emailIntent.setType("message/rfc822");
        emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[]{email});
        emailIntent.putExtra(Intent.EXTRA_SUBJECT, subject);
        emailIntent.putExtra(Intent.EXTRA_TEXT, emailBody);

        emailIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

        try {
            QuickUtils.getContext().startActivity(emailIntent);
        } catch (android.content.ActivityNotFoundException ex) {
            QuickUtils.system.toast("There are no email clients installed.");
        }
    }
579454
@SuppressWarnings("unchecked")
    protected void initUserObject() {

        try {
            if (CmsStringUtil.isEmpty(getParamAction()) || CmsDialog.DIALOG_INITIAL.equals(getParamAction())) {
                // edit an existing user, get the user object from db
                m_user = getCms().readUser(new CmsUUID(getParamUserid()));
                if (!Boolean.valueOf(getParamEditall()).booleanValue()) {
                    m_addInfoList = createAddInfoList(m_user);
                } else {
                    setAddInfoMaps();
                }
                return;
            } else {
                // this is not the initial call, get the user object from session
                m_user = getCms().readUser(new CmsUUID(getParamUserid()));
                if (!Boolean.valueOf(getParamEditall()).booleanValue()) {
                    m_addInfoList = (List<CmsUserAddInfoBean>)getDialogObject();
                } else {
                    Map<String, SortedMap<String, Object>> dObj = (Map<String, SortedMap<String, Object>>)getDialogObject();
                    m_addInfoEditable = dObj.get("editable");
                    m_addInfoReadOnly = dObj.get("readonly");
                }
                return;
            }
        } catch (Exception e) {
            // noop
        }
        // create a new user object
        try {
            m_user = getCms().readUser(new CmsUUID(getParamUserid()));
        } catch (CmsException e) {
            // ignore
        }
        if (!Boolean.valueOf(getParamEditall()).booleanValue()) {
            m_addInfoList = createAddInfoList(m_user);
        } else {
            setAddInfoMaps();
        }
    }
946882
public void addSigner(String email, String name) throws HelloSignException {
        signers.add(new Signer(email, name));
    }
984463
public void createUser(User user, String password){
        ProtocolHeader header = new ProtocolHeader();
        header.setType(ProtocolType.CreateUser);
        byte[] secret = null;
        if(password != null && ! password.isEmpty()){
            secret = ObfuscatUtil.base64Encode(password.getBytes());
        }
        CreateUserProtocol p = new CreateUserProtocol(user, secret);

        connection.submitRequest(header, p, null);
    }
145396
def send_invite_user_email(self, user, user_invitation):
        """"""

        # Verify config settings
        if not self.user_manager.USER_ENABLE_EMAIL: return
        if not self.user_manager.USER_ENABLE_INVITE_USER: return

        # The user param points to the inviter
        # The user_invitation param points to the invitee
        invited_by_user = user

        # Use the invitation email
        email = user_invitation.email

        # Create a dummy user object to an empty name for the invitee
        user = self.user_manager.db_manager.UserClass(email=email)

        # Generate a accept_invitation_link
        token = self.user_manager.generate_token(user_invitation.id)
        accept_invitation_link = url_for('user.register', token=token, _external=True)

        # Render email from templates and send it via the configured EmailAdapter
        self._render_and_send_email(
            email,
            user,
            self.user_manager.USER_INVITE_USER_EMAIL_TEMPLATE,
            accept_invitation_link=accept_invitation_link,
            invited_by_user=invited_by_user,
        )
1042102
protected void setUserData(CmsUser user, CmsListItem item) {

        item.set(LIST_COLUMN_LOGIN, user.getName());
        item.set(LIST_COLUMN_NAME, user.getFullName());
        item.set(LIST_COLUMN_EMAIL, user.getEmail());
        item.set(LIST_COLUMN_LASTLOGIN, new Date(user.getLastlogin()));
    }
414192
public void sendMail (String to, String subject, String content) throws MessagingException {
        Properties props = new Properties();
        props.put("mail.smtp.user", emailConfg.getUser());
        props.put("mail.smtp.host", emailConfg.getHost());
        props.put("mail.smtp.port", emailConfg.getPort());
        props.put("mail.smtp.starttls.enable","true");
        props.put("mail.smtp.debug", emailConfg.getDebug());
        props.put("mail.smtp.auth", emailConfg.getAuth());
        props.put("mail.smtp.ssl.trust", emailConfg.host);

        SMTPAuthenticator auth = new SMTPAuthenticator(emailConfg.getUser(), (String)secret.get(SecretConstants.EMAIL_PASSWORD));
        Session session = Session.getInstance(props, auth);

        MimeMessage message = new MimeMessage(session);

        message.setFrom(new InternetAddress(emailConfg.getUser()));
        message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));

        message.setSubject(subject);

        message.setContent(content, "text/html");

        // Send message
        Transport.send(message);
        if(logger.isInfoEnabled()) logger.info("An email has been sent to " + to + " with subject " + subject);
    }
1163197
public void setUserCreated(String userCreated) {

        try {
            String userCreatedName = OpenCms.getImportExportManager().translateUser(userCreated);
            try {
                m_resourceBuilder.setUserCreated(getCms().readUser(userCreatedName).getId());
            } catch (@SuppressWarnings("unused") CmsDbEntryNotFoundException e) {
                m_resourceBuilder.setUserCreated(getRequestContext().getCurrentUser().getId());
            }
        } catch (Throwable e) {
            setThrowable(e);
        }
    }
689723
public void checkCreateSessionForUser(CmsUser user) throws CmsException {

        if (getUserSessionMode() == UserSessionMode.single) {
            List<CmsSessionInfo> infos = getSessionInfos(user.getId());
            if (!infos.isEmpty()) {
                throw new CmsCustomLoginException(
                    org.opencms.security.Messages.get().container(
                        org.opencms.security.Messages.ERR_ALREADY_LOGGED_IN_0));
            }
        }

    }
1081825
public Email recipient(EmailAddress recipient, RecipientType type) {
		recipient(new Recipient(recipient, type));
		return this;
	}
1287314
public void setProxyuser(String proxyuser) throws ApplicationException {
	try {
	    smtp.getProxyData().setUsername(proxyuser);
	}
	catch (Exception e) {
	    throw new ApplicationException("attribute [proxyuser] of the tag [mail] is invalid", e.getMessage());
	}
    }