# email and ansible

**URL:** <https://forum.ansible.com/t/email-and-ansible/17684>\
**Category:** Ansible Project\
**Created:** [March 5, 2015, 9:17pm UTC](https://forum.ansible.com/t/email-and-ansible/17684 "2015-03-05T21:17:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antoine\_Voiry](https://avatars.discourse-cdn.com/v4/letter/a/a587f6/32.png) [@Antoine\_Voiry](https://forum.ansible.com/u/Antoine_Voiry)\
**Post date:** [March 5, 2015, 9:17pm UTC](https://forum.ansible.com/t/email-and-ansible/17684/1 "2015-03-05T21:17:35Z")

</div>

All,  
I am trying to get emails and html template.  
I get a message saying var are added in the replaced body text.  
Any idea of where that come from?

- name: delete temp dir  
local\_action: file path=./tmp state=absent

- name: template create dir  
local\_action: file path=./tmp state=directory

- name: template email  
local\_action: template src=…/files/email\_template.j2 dest=./tmp/email.txt

- name: send email  
local\_action: mail  
host=‘[smtp3.hp.com](http://smtp3.hp.com)’  
port=25  
subject=“EGIT IIB ENVIRONMENT SETUP”  
from=“email”  
body=“{{ lookup(‘file’, ‘./tmp/email.txt’) }}”  
to=“email”  
headers=“Content-type=text/html”  
when: (managed\_server\_name == “AdminServer”)

The template is a HTML file.

Antone
