I was trying to send an email with high importance using community.general.mail, below is the script that I’m using.
but these are getting skipped. IDK why. If any one have worked with it please help.
- hosts: localhost
gather_facts: no
vars:
in_to:
- "dummy1@outlook.com"
in_cc:
- "dummy2@outlook.com"
tasks:
- block:
- name: Sending an e-mail when the compatibility check fails
mail:
host: "smtp-mail.outlook.com"
port: "587"
username: "user@outlook.com"
password: "PASSWORD"
from: "user@outlook.com"
to: "{{ in_to | join(',') }}"
cc: "{{ in_cc | join(',') }}"
subject: Compatibility check Failed
headers:
- X-Priority: "1"
- X-MSMail-Priority: "High"
- Importance: "High"
body: "Please do the necessary validations involved."
rescue:
- debug:
msg: "Error in Sending Email"
PLAY [localhost] **************************************************************************************************************
TASK [Sending an e-mail when the compatibility check fails] *******************************************************************
[WARNING]: Skipping header '{'X-Priority': '1'}', unable to parse
[WARNING]: Skipping header '{'X-MSMail-Priority': 'High'}', unable to parse
[WARNING]: Skipping header '{'Importance': 'High'}', unable to parse
ok: [localhost]