This module is useful for sending emails from playbooks. ,One may wonder why automate sending emails? In complex environments there are from time to time processes that cannot be automated, either because you lack the authority to make it so, or because not everyone agrees to a common approach. ,If you cannot automate a specific step, but the step is non-blocking, sending out an email to the responsible party to make him perform his part of the bargain is an elegant way to put the responsibility in someone else's lap. ,Of course sending out a mail can be equally useful as a way to notify one or more people in a team that a specific action has been (successfully) taken.

Options

namedescriptionrequiredchoices
from The email-address the mail is sent from. May contain address and phrase.
to The email-address(es) the mail is being sent to. This is a comma-separated list, which may contain address and phrase portions.
cc The email-address(es) the mail is being copied to. This is a comma-separated list, which may contain address and phrase portions.
bcc The email-address(es) the mail is being 'blind' copied to. This is a comma-separated list, which may contain address and phrase portions.
subject The subject of the email being sent. true
body The body of the email being sent.
username If SMTP requires username
password If SMTP requires password
host The mail server
port The mail server port
attach 1. space-separated list of pathnames of files to attach to the message. Attached files will have their content-type set to C(application/octet-stream).
headers 1. vertical-bar-separated list of headers which should be added to the message. Each individual header is specified as C(header=value) (see example below).
charset The character set of email being sent
subtype The minor mime type, can be either text or html. The major type is always text.

Author

Dag Wieers (@dagwieers)