# How to send email with content from .yml file\[Ansible\]

**URL:** <https://forum.ansible.com/t/how-to-send-email-with-content-from-yml-file-ansible/27757>\
**Category:** Ansible Project\
**Created:** [June 9, 2018, 1:03pm UTC](https://forum.ansible.com/t/how-to-send-email-with-content-from-yml-file-ansible/27757 "2018-06-09T13:03:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![devopsram2012](https://avatars.discourse-cdn.com/v4/letter/d/0ea827/32.png) [@devopsram2012](https://forum.ansible.com/u/devopsram2012)\
**Post date:** [June 9, 2018, 1:03pm UTC](https://forum.ansible.com/t/how-to-send-email-with-content-from-yml-file-ansible/27757/1 "2018-06-09T13:03:48Z")

</div>

Dear All,  
I want to send email with content from .yml file output .

I’ve created Jenkins job using groovy script and Inside groovy I’m using shell script to call .yml file and inside I’m checking urls health check using Ansible’s URI module.

Output on the Jenkins console of .yml file display with key words as “Item”, “msg”, “Status/Status/Code” and “url” and some values against “Item”, “msg”, “Status/Status/Code” and “url”.

I want to read these output of the .yml file and send to email in HMTL format.  
In HTML page header/column of the email will be like below:

**URL**  **Staus\_Code**  **MSG**  
[https://xyz.com](https://xyz.com) 200,301 Ok  
[https://abc.com](https://abc.com) -1 ‘Status code was not [200, 301]: Request failed: \<urlopen error [Errno 111] Connection refused\>’, u’redirected’

**NOTE:**  
Here values against URL, Status\_Code and MSG is being displayed on Jenkins console as .yml file’s output

Please guide and suggest as I’m new to Ansible.

Thanks & Regards  
Ram
