# using mail module with Windows roles

**URL:** <https://forum.ansible.com/t/using-mail-module-with-windows-roles/30779>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [July 15, 2019, 8:46am UTC](https://forum.ansible.com/t/using-mail-module-with-windows-roles/30779 "2019-07-15T08:46:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam2](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@Sam2](https://forum.ansible.com/u/Sam2)\
**Post date:** [July 15, 2019, 8:46am UTC](https://forum.ansible.com/t/using-mail-module-with-windows-roles/30779/1 "2019-07-15T08:46:56Z")

</div>

Hi all,

I am facing an issue where I have written playbook with roles to configure and install Windows machines, the problem is when I try to send a notification email inside a task of a role, then the mail module will fail as it tried to use Ansible connection (set to winrm).

I tried to delegate to local host and I tried also to use local\_action option, but both failed ☹

I though of move all the tasks into a main Playbook but that will need to re-structure the whole thing.

Can anyone please suggest the best way do this ?

Thanks  
Samer
