# mail module

**URL:** <https://forum.ansible.com/t/mail-module/33846>\
**Category:** Ansible Project\
**Created:** [September 18, 2020, 5:52am UTC](https://forum.ansible.com/t/mail-module/33846 "2020-09-18T05:52:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![P\_R\_Music\_video\_s](https://avatars.discourse-cdn.com/v4/letter/p/eb8c5e/32.png) [@P\_R\_Music\_video\_s](https://forum.ansible.com/u/P_R_Music_video_s)\
**Post date:** [September 18, 2020, 5:52am UTC](https://forum.ansible.com/t/mail-module/33846/1 "2020-09-18T05:52:50Z")

</div>

hi team i need one help with the mail module  
it is throwing error address family not supported  
if anyone know how to send mail when the task failed please help

thanks  
prajwal h g

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [September 18, 2020, 5:54am UTC](https://forum.ansible.com/t/mail-module/33846/2 "2020-09-18T05:54:39Z")

</div>

Post your playbook

---

<div class="post-metadata">

**Author:** ![P\_R\_Music\_video\_s](https://avatars.discourse-cdn.com/v4/letter/p/eb8c5e/32.png) [@P\_R\_Music\_video\_s](https://forum.ansible.com/u/P_R_Music_video_s)\
**Post date:** [September 19, 2020, 9:01am UTC](https://forum.ansible.com/t/mail-module/33846/3 "2020-09-19T09:01:03Z")

</div>

here is my playbook

---

<div class="post-metadata">

**Author:** ![P\_R\_Music\_video\_s](https://avatars.discourse-cdn.com/v4/letter/p/eb8c5e/32.png) [@P\_R\_Music\_video\_s](https://forum.ansible.com/u/P_R_Music_video_s)\
**Post date:** [September 20, 2020, 4:37am UTC](https://forum.ansible.com/t/mail-module/33846/4 "2020-09-20T04:37:31Z")

</div>

hi team can you please suggest a solution if anyone knows whats happening here

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [September 20, 2020, 6:24am UTC](https://forum.ansible.com/t/mail-module/33846/5 "2020-09-20T06:24:45Z")

</div>

There is no 'sender' argument. See  
[https://docs.ansible.com/ansible/latest/modules/mail\_module.html](https://docs.ansible.com/ansible/latest/modules/mail_module.html)

Other than that it looks OK.  
So, what is the EXACT error output you get when running the task\>?  
Also what version etc etc.

And keep in mind Gmail requires an application specific password:  
[https://support.google.com/mail/answer/185833?hl=en](https://support.google.com/mail/answer/185833?hl=en)

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [September 20, 2020, 6:33am UTC](https://forum.ansible.com/t/mail-module/33846/6 "2020-09-20T06:33:14Z")

</div>

Actually 'sender' is an undocumted alias for 'from', so this will work.

---

<div class="post-metadata">

**Author:** ![P\_R\_Music\_video\_s](https://avatars.discourse-cdn.com/v4/letter/p/eb8c5e/32.png) [@P\_R\_Music\_video\_s](https://forum.ansible.com/u/P_R_Music_video_s)\
**Post date:** [September 20, 2020, 1:49pm UTC](https://forum.ansible.com/t/mail-module/33846/7 "2020-09-20T13:49:49Z")

</div>

I attached my ansible version screen shot and error screenshot please look at this and help me out as soon as possible I stuck up with this problem for a week

Thanks  
Prajwal h g

> **(attachments)**
>
> ![IMG_20200920_190453.jpg](https://us1.discourse-cdn.com/ansible/original/2X/f/fc031751c00a15304b76157db4c8efe599be7b3b.jpeg)  
> ![IMG_20200920_190304.jpg](https://us1.discourse-cdn.com/ansible/original/2X/6/691892613401d0391be9779d7220053c328e6738.jpeg)

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [September 20, 2020, 2:33pm UTC](https://forum.ansible.com/t/mail-module/33846/8 "2020-09-20T14:33:29Z")

</div>

> I attached my ansible version screen shot and error screenshot please look at this and help me out as soon as possible I stuck up with this problem for a week

Sounds like bad planning on your side.  
You might get more help if you provide better information to start  
with, and change your attitude.  
This list is run by volunteers, so don't order them around.

The issue is with your controller node, it appears to have some  
screwed up network configuration.  
Check manually if you can set up connections to the specific  
host/port, for instance with OpenSSL s\_client:

echo "EHLO blah.com" | openssl s\_client -starttls smtp -crlf -connect  
smtp.gmail.com:587

This should give you a 250 response code. If it doesn't work, then you  
need to fix that. If it's fixed, then your ansible playbook should  
also work.

PS next time just post actual text if asked, and not some shaky 3MB photo...

Dick
