mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-21 00:06:51 +00:00
Add clarity to apostrophes meaning in SMTP docs (#17265)
This commit is contained in:
parent
482422f675
commit
f4f408b417
@ -12,17 +12,17 @@ ha_platforms:
|
|||||||
- notify
|
- notify
|
||||||
---
|
---
|
||||||
|
|
||||||
The `smtp` platform allows you to deliver notifications from Home Assistant to an e-mail recipient.
|
The SMTP platform allows you to deliver notifications from Home Assistant to an e-mail recipient.
|
||||||
|
|
||||||
To enable notification by e-mail in your installation, add the following to your `configuration.yaml` file:
|
To enable notification by e-mail in your installation, add the following to your `configuration.yaml` file:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
notify:
|
notify:
|
||||||
- name: NOTIFIER_NAME
|
- name: "NOTIFIER_NAME"
|
||||||
platform: smtp
|
platform: smtp
|
||||||
sender: YOUR_SENDER
|
sender: "YOUR_SENDER"
|
||||||
recipient: YOUR_RECIPIENT
|
recipient: "YOUR_RECIPIENT"
|
||||||
```
|
```
|
||||||
|
|
||||||
{% configuration %}
|
{% configuration %}
|
||||||
@ -59,7 +59,7 @@ username:
|
|||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
password:
|
password:
|
||||||
description: Password for the SMTP server that belongs to the given username. If the password contains a colon it need to be wrapped in apostrophes.
|
description: Password for the SMTP server that belongs to the given username. Make sure to wrap it in double quotes; e.g., `"MY_PASSWORD"`.
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
encryption:
|
encryption:
|
||||||
@ -72,7 +72,7 @@ sender_name:
|
|||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
debug:
|
debug:
|
||||||
description: Enables Debug, e.g., True or False.
|
description: Enables Debug, e.g., `true` or `false`.
|
||||||
required: false
|
required: false
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
@ -83,19 +83,19 @@ A sample configuration entry for Google Mail.
|
|||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
notify:
|
notify:
|
||||||
- name: NOTIFIER_NAME
|
- name: "NOTIFIER_NAME"
|
||||||
platform: smtp
|
platform: smtp
|
||||||
server: smtp.gmail.com
|
server: "smtp.gmail.com"
|
||||||
port: 587
|
port: 587
|
||||||
timeout: 15
|
timeout: 15
|
||||||
sender: john@gmail.com
|
sender: "john@gmail.com"
|
||||||
encryption: starttls
|
encryption: starttls
|
||||||
username: john@gmail.com
|
username: "john@gmail.com"
|
||||||
password: thePassword
|
password: "thePassword"
|
||||||
recipient:
|
recipient:
|
||||||
- james@gmail.com
|
- "james@gmail.com"
|
||||||
- bob@gmail.com
|
- "bob@gmail.com"
|
||||||
sender_name: My Home Assistant
|
sender_name: "My Home Assistant"
|
||||||
```
|
```
|
||||||
|
|
||||||
Keep in mind that Google has some extra layers of protection which need special attention (Hint: 'Less secure apps'). If you have 2-step verification enabled on your Google account, you'll need to use [an application-specific password](https://support.google.com/mail/answer/185833?hl=en).
|
Keep in mind that Google has some extra layers of protection which need special attention (Hint: 'Less secure apps'). If you have 2-step verification enabled on your Google account, you'll need to use [an application-specific password](https://support.google.com/mail/answer/185833?hl=en).
|
||||||
@ -103,7 +103,7 @@ Keep in mind that Google has some extra layers of protection which need special
|
|||||||
To use the SMTP notification, refer to it in an automation or script like in this example:
|
To use the SMTP notification, refer to it in an automation or script like in this example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
burglar:
|
burglar:
|
||||||
alias: "Burglar Alarm"
|
alias: "Burglar Alarm"
|
||||||
sequence:
|
sequence:
|
||||||
- service: shell_command.snapshot
|
- service: shell_command.snapshot
|
||||||
@ -124,7 +124,7 @@ The optional `images` field adds in-line image attachments to the email. This se
|
|||||||
The optional `html` field makes a custom text/HTML multi-part message, allowing total freedom for sending rich html emails. In them, if you need to attach images, you can pass both arguments (`html` and `images`), the attachments will be joined with the basename of the images, so they can be included in the html page with `src="cid:image_name.ext"`.
|
The optional `html` field makes a custom text/HTML multi-part message, allowing total freedom for sending rich html emails. In them, if you need to attach images, you can pass both arguments (`html` and `images`), the attachments will be joined with the basename of the images, so they can be included in the html page with `src="cid:image_name.ext"`.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
burglar:
|
burglar:
|
||||||
alias: "Burglar Alarm"
|
alias: "Burglar Alarm"
|
||||||
sequence:
|
sequence:
|
||||||
- service: shell_command.snapshot
|
- service: shell_command.snapshot
|
||||||
@ -190,8 +190,6 @@ This platform is fragile and not able to catch all exceptions in a smart way bec
|
|||||||
|
|
||||||
A combination that will work properly is port 587 and STARTTLS. It's recommended to enable STARTTLS, if possible.
|
A combination that will work properly is port 587 and STARTTLS. It's recommended to enable STARTTLS, if possible.
|
||||||
|
|
||||||
Keep in mind that if the password contains a colon, it needs to be wrapped in apostrophes in the `configuration.yaml` file.
|
|
||||||
|
|
||||||
For Google Mail (smtp.gmail.com) an additional step in the setup process is needed. Google has some extra layers of protection
|
For Google Mail (smtp.gmail.com) an additional step in the setup process is needed. Google has some extra layers of protection
|
||||||
which need special attention. By default, the usage by external applications, especially scripts, is limited. Visit the [Less secure apps](https://www.google.com/settings/security/lesssecureapps) page and enable it.
|
which need special attention. By default, the usage by external applications, especially scripts, is limited. Visit the [Less secure apps](https://www.google.com/settings/security/lesssecureapps) page and enable it.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user