SweetAlert2 (Swal is not defined) How to solve?

SweetAlert2 (Swal is not defined) How to solve?

When I click the button, no action is taken. On the "Console" I get the following message: "Uncaught ReferenceError: Swal is not defined". How to solve this, what is missing from my code?

I have the following in HTML:

  1. <button type="button" class="btn btn-primary btn-icon-text float-right mt-4 ml-2" data-idfinancial="{$id_financial}" id="sendmensagem">
                         <i class="btn-icon-prepend" data-feather="mail"></i> Enviar E-mail

The JS script looks like this:

  1. <script>
    $(document).ready(function() {

    $("#sendmensagem").click(function() {
    var thedataID = $(this).attr("data-idfinancial");
      async: true,
      type: "GET",
      url: 'send-financial.php?id=' + thedataID,

      success: function(data) {

      if (data == 'false') {
        // Sem erros

            icon: 'success',
            title: 'Sucesso',
            text: 'Sua mensagem foi enviada!',
            footer: '<a href="javascript:;">Responderemos assim que possível.</a>',
            timer: 3000,
            timerProgressBar: true

      } else {
        // Com erros

            icon: 'error',
            title: 'Ops...',
            text: 'Algo deu errado!',
            footer: '<a href="javascript:;">Por favor, tente novamente mais tarde!</a>',
            timer: 3000,
            timerProgressBar: true
      error: function(data) {

PS: The CSS and JS files are set correctly.

Juscelino Barão