code: @Override
      public String send() {
  
          String messageID = null;
          try {
              messageID = super.send();
          } catch (EmailException e) {
              // check if original Exception is of type SendFailedException which
              // should have been thrown by javax.mail.Transport.send()
              if (e.getCause() instanceof AuthenticationFailedException) {
                  CmsMailHost host = OpenCms.getSystemInfo().getMailSettings().getDefaultMailHost();
                  // wrong user credentials in opencms-system.xml: mail api does not provide a message for authentication exception
  
                  CmsRuntimeException rte = new CmsRuntimeException(
                      Messages.get().container(
                          Messages.ERR_SEND_EMAIL_AUTHENTICATE_2,
                          host.getUsername(),
                          host.getHostname()));
                  rte.initCause(e);
                  throw rte;
  
              } else {
                  CmsRuntimeException rte = new CmsRuntimeException(
                      Messages.get().container(Messages.ERR_SEND_EMAIL_CONFIG_0));
                  rte.initCause(e);
                  throw rte;
              }
          }
          return messageID;
      }
docs: Overrides to add a better message for authentication exception.<p>
  
  @see org.apache.commons.mail.Email#send()