Hi, can someone help me, I can’t send an email notification with attachment using smtp.
hassio version 0.98.1
this is my scripts
send_email_attachement:
alias: "Send email snapshot"
sequence:
- service: notify.email
data:
message: "hello world"
title: "hello"
data:
images: /tmp/snapshot.jpg
and this is the full log error that i get
Log Details (ERROR)
Sun Sep 01 2019 23:51:42 GMT+0200 (heure d’été d’Europe centrale)
Error executing script script.send_email_attachement. Unknown error for call_service at pos 1:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 209, in async_turn_on
await self.script.async_run(kwargs.get(ATTR_VARIABLES), context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 151, in async_run
await self._handle_action(action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 235, in _handle_action
await self._actions[_determine_action(action)](action, variables, context)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 318, in _async_call_service
context=context,
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 98, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context
File "/usr/src/homeassistant/homeassistant/core.py", line 1235, in async_call
await asyncio.shield(self._execute_service(handler, service_call))
File "/usr/src/homeassistant/homeassistant/core.py", line 1260, in _execute_service
await handler.func(service_call)
File "/usr/src/homeassistant/homeassistant/components/notify/__init__.py", line 120, in async_notify_message
await notify_service.async_send_message(**kwargs)
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 178, in send_message
msg = _build_multipart_msg(message, images=data.get(ATTR_IMAGES, []))
File "/usr/src/homeassistant/homeassistant/components/smtp/notify.py", line 234, in _build_multipart_msg
with open(atch_name, "rb") as attachment_file:
IsADirectoryError: [Errno 21] Is a directory: '/'