SMTP in YAML Phase out

Upgraded to 2026.8.0, and see the SMTP warnings, I have 100s of custom automations with variables, states and other stuff, do we have to manually edit all the automatons to change the notification method now ? Seems a little crazy, as I have to redo every other automation since I use SMTP extensively as my notification method.

Yes you will have to edit all the automations… just like everybody who uses Telegram Bot, Matrix, ntfy, Mastodon, File, and a bunch of others have already done for those integrations… and just like everybody using pretty much every legacy notification integration will have to do eventually as those integrations get updated to the entity-based approach.

For any of your notifications where you are only using message and title, now would be a good time to switch to notify.send_message. For those that include html or attachments, you’ll need to use smtp.send_message.

There is one feature of the legacy actions which is not currently supported; neither of the new actions allow you to send the notification to any email of your choosing. They both require the user to pre-define ā€œrecipientsā€, i.e. notify entities that hold the target email address data for a specific instance of SMTP.

I would suggest give your automations yaml to a gemini/gpt and have it adjust all of it. Saves you a ton of work

I am using a lot of scripts and automations with the ā€œoldā€ notify method to send mails with attachments.

- data:
      title: Door Bell
      message: Somebody is ringing.
      data:
        images:
          - www/images/cp1001.jpg
          - www/images/cp1002.jpg
          - www/images/cp1003.jpg
          - www/images/cp2001.jpg
          - www/images/cp2002.jpg
          - www/images/cp2003.jpg
    action: notify.mail_benachrichtigung
    enabled: true

How to migrate this to
smtp.send_message ?
I have tried several possibilities but nothing works.

Thx
Walter

I find a solution.

Add the directory in the configuration.yaml:

homeassistant:
  media_dirs:
    images: /config/www/images

If you select ā€œattachmentā€ you’ll find in the media-source ā€œMy Mediaā€ with all the files of the directory.

I too have this same issue, and got a message indicating I needed to make changes by march next year. Seems like this should have been flagged in the Backwards incompatible section of the release notes! :slight_smile:

The legacy actions should continue to work for the next 6 months, so there isn’t currently anything ā€œincompatibleā€ about them. A ā€œBackwards Incompatible Changeā€ notice will likely be posted in the release where the old actions actually become incompatible.

I’ve received the same ā€œDetected use of deprecated action notify.<smtp_action>ā€ Warning Reported by SMTP to address before 2027.3.0.

Are there any plans for some kind of automated ā€œRepairā€ feature (at least where there is no ambiguity in moving to either notify.send_message or smtp.send_message)?
Otherwise it’s a rather fragile (and onerous) manual find/replace through my automations.yaml.

I’m going round in circles trying to convert legacy sending emails with attachments, repeatedly getting Error: expected a dictionary for dictionary value @ data[ā€˜attachments’][0][ā€˜media_source’]
I setup 'media sources in configuration.yaml -

homeassistant:
  allowlist_external_dirs:
    - /config/my-logs
  media_dirs:
    media: /media
    local: /config/my-logs

but I can’t see any files in either my Media\media or my Media\my-logs despite there being files in those locations. When I try an upload through my Media\media add the file browser is limited to supported files, which doesn’t apparently include logs or text files so it seems we have lost some functionality here, I used to email logs as attachments without issue. If anyone can point out where I’m going wrong I would much appreciate it.

Finally sussed out attaching a log file to an email:

actions:
  - action: smtp.send_message
    metadata: {}
    target:
      entity_id: notify.mailsrv_recipient_email
    data:
      title: Daily energy log
      message: Here is the daily energy log
      attachments:
        - media_source:
            media_content_id: >-
              media-source://media_source/local/energy_daily_readings.log
            media_content_type: text/plain
            metadata:
              title: energy_daily_readings.log
              thumbnail: null
              media_class: text
              children_media_class: null
              navigateIds:
                - {}
                - media_content_type: app
                  media_content_id: media-source://media_source
                - media_content_type: ''
                  media_content_id: media-source://media_source/local/.
          content_id: '1'

I just used standard file type descriptor values for media_content_type and media_class and it seems to work. Also I don’t seem to be able to do this from the GUI I had to fallback on yaml, but that maybe me. Seems unduly complicated just to attach a file so maybe I have misunderstood something?

WOW, I thought migrating the Gemini automations was hell, this is not going to be fun at all. I would think in this day and age, there would be automated migration path, for software that automate things this seems silly… Maybe some one or something can whip a script that automates things, I didnt even try to convert anything yet, but by reading the above it seems to use the new media way which also is not easy to just reproduce…

Besides running this thru AI, if someone can come up with a good way to automate the migration please drop a line below.