--- - hosts: all connection: local collections: - cyberark.pas tasks: - name: Sending an e-mail using Gmail SMTP servers community.general.mail: host: SMTPSERVER port: PORT username: username@mail.com password: password to: First Last subject: Ansible-Rulebook Report body: Ansible Rulebook notify of PTA Event '{{ username | ansible.builtin.regex_search('^[a-zA-Z0-9_]+') }}' '{{ eventname }}' from host '{{ station }}' For more info please visit - '{{ eventurl }}' delegate_to: localhost