web-installer/src/utils/buttons.js
// Sends test emails to every email provided in the "to" array.
Sends test emails to every email provided in the "to" array.
Sends test emails to every email provided in the " to " array .
function SendTestEmailButton({
  disabled, to, smtp, from, user, pass, port,
}) {
  const onClick = async () => {
    to.forEach(async (emailTo) => {
      try {
        ToastsStore.info(`Sending test e-mail to address ${to}`, 5000);
        await sendTestEmail(smtp, from, emailTo, user, pass, port);
        ToastsStore.success('Test e-mail sent successfully, check inbox', 5000);
      } catch (e) {
        if (e.response) {
          ToastsStore.error(`Could not send test e-mail. Error: ${e.response.data.error}`, 5000);
        } else {
          ToastsStore.error(`Could not send test e-mail. Error: ${e.message}`, 5000);
        }
      }
    });
  };
  return (
    <Button color="primary" size="md" disabled={disabled} onClick={onClick}>
      Test
    </Button>
  );
}
function SendTestEmailButton ( { disabled , to , smtp , from , user , pass , port , } ) { const onClick = async ( ) => { to . forEach ( async ( emailTo ) => { try { ToastsStore . info ( ` ${ to } ` , 5000 ) ; await sendTestEmail ( smtp , from , emailTo , user , pass , port ) ; ToastsStore . success ( 'Test e-mail sent successfully, check inbox' , 5000 ) ; } catch ( e ) { if ( e . response ) { ToastsStore . error ( ` ${ e . response . data . error } ` , 5000 ) ; } else { ToastsStore . error ( ` ${ e . message } ` , 5000 ) ; } } } ) ; } ; return ( < Button color = "primary" size = "md" disabled = { disabled } onClick = { onClick } > 
      Test
     < / Button > ) ; }
Sends test emails to every email provided in the "to" array.
Sends test emails to every email provided in the " to " array .
// The request was made and the server responded with a status code // that falls out of the range of 2xx // Something happened in setting up the request that triggered an error