error sending mail

“The module mail was redirected to community.general.notification.mail, which could not be loaded.”

code:

  • name: Mail
    mail:
    host: server.com
    port: XXX
    username: XXXXXXXX
    password: XXXXXXXXXX
    body: ‘Change 1205 is live.’

Hi,

did you install the community.general collection?

Cheers,
Felix

Yes.
I install contains collector.
Example:
requirements.yml

collections:

Install ansible.posix Ansible Collection

  • name: community.windows

source: https://galaxy.ansible.com

  • name: community.general

source: https://galaxy.ansible.com

  • name: ansible.windows

source: https://galaxy.ansible.com

it’s solved! =)

I add:

  • name: Mail
    mail:
    host: server.com
    port: XXX
    username: XXXXXXXX
    password: XXXXXXXXXX
    body: 'Change 1205 is live.

delegate_to: localhost

it works fine

https://github.com/ansible-collections/community.general/issues/4943