diff --git a/src/Effect.Email.purs b/src/Effect.Email.purs index 890e6de..c1b7cde 100644 --- a/src/Effect.Email.purs +++ b/src/Effect.Email.purs @@ -86,9 +86,9 @@ deliverableOnce email' = do { reachable, syntax, mx, smtp } <- lift $ Promise.toAffE $ checkEmailImpl email when (not syntax.valid) $ throwError $ EmailSyntaxInvalid email' when (not mx.valid) $ throwError $ EmailMXInvalid email' - when (not smtp.valid) $ throwError $ EmailSMTPInvalid email' when (maybe true Array.null $ Nullable.toMaybe $ mx.mxRecords) $ throwError $ EmailMXNoRecords email' for_ (Nullable.toMaybe $ smtp.error) $ throwError <<< EmailSMTPError email' + when (not smtp.valid) $ throwError $ EmailSMTPInvalid email' when (not reachable) $ throwError $ EmailUnreachable email' pure email'