Is anyone able to email pictures using gmail?

I am able to send emails with either smtp using a google account or the google mail integration.

But when I add

  images: 
    - /config/www/tmp/something.jpg

when sending either way, I get extra keys not allowed @ data[images]. The google mail integration does not list images: as a possible attribute.

When I send emails from my home camera and doorbell with a gmail account I am able to send pictures so I’m really surprised I can’t with HA. Is there some kind of work around for this? I really want to be able to send pictures from my cameras. Keeping my fingers crossed!

I am sending pictures using a script with the
Email notification service.
I have an automation that calls the script when my camera has a motion.

service: notify.email_notifier
data:
  message: Kelsey.AI Detected Someone at the Front Door!
  title: Person Detected Alert! {{ now().strftime("%Y%m%d-%H%M%S") }}
  data:
    images:
      - /config/www/snapshots/porch_best.jpg
      - /config/www/snapshots/driveway_best.jpg

And you are using gmail@pcwii?

It is a Gmail address but I am using the smtp configuration.

Thanks again @pcwii

I wonder why I get the error on images then. I think I’ll remove the Google mail integration just to make sure it isn’t having any effect on my SMTP attempts.

Got it working - thanks so much @pcwii !

1 Like

I’m not able to send images either but I’m using the Google Mail integration.
(I used to be able to fine before shifting to the integration method because of the GM app security changes).

I can send an email from this service call fine, but no image is being attached just the title and message text. Not getting a failure or error message.
I am wondering if Google Mail is blocking the attachments, or if I’m missing something about using SMTP?

Using this service call inside a triggered automation (template details replaced by xxxxxx)

service: notify.xxxxxxx
data:
  message: The garage door has been open for 10 minutes.
  title: Your Garage Door Friend
  target: xxxxxxxx
  data:
    images:
      - /share/mycamera/snapshot_camera.jpg

Make sure you can actually access the image in your path. My gmail does send images. Here is my images path for reference.
/config/www/snapshots/porch_latest.jpg

Cheers for the response. Yep double checked after your suggestion. No seems fine as it’s also the path string used by my Telegram service that is sending the same images fine.

Trying to resolve this non transmission of images. I note that in the HA Google Mail integrations usage description that ‘images’ is not listed in the attributes valid for ‘data’ key…
Does this mean it’s never been an option, or as usual I don’t understand something?

Google Mail - Home Assistant (home-assistant.io)

Mine definitely is sending pictures.
I am using the smtp setup.
I posted information here previously.

In my experience images work fine when using SMTP with a gmail server but not when using the Gmail integration.

Thanks mate, that’s what I needed to know “not when using the Google Mail integration”.

Yep I hear you about SMTP. Up until late last year I too ONLY used the SMTP service via notify: in my config.yaml, with images, just fine.
Then something changed, either Gmail credential requirements or it broke in HA, but whatever I try now via configured via SMTP now fails. Tried to reconfigure for gmail using app passwords etc and then tried outlook email from fresh, neither work (though never had outlook before). SMTP service via ‘developer’ options indicates the emails are sent, but nothing arrives at the addressed mailbox, there are some vague log errors for SMTP.

From googling the log errors caused by SMTP I’m not alone, there a few other users who’s SMTP broke in the last 5-6 months without much clue other than maybe issues with StartTLS encryption.

So, I’d hoped the HA Google Mail integration would fix my problem, I could move on. It does send, but not with an attachment. Didn’t see that in the description…

I never got this to work with the gmail integration - I’m using smtp. I send images all of the time from my cameras. I’m also emailing texts to my phones with pictures.

Here’s my notify.yaml - are you using the same port?

- name: "gmail_smtp_email"
  platform: smtp
  server: smtp.gmail.com
  port: 587
  timeout: 15
  sender_name: "Home Assistant Notification"
  sender: !secret emailFrom
  encryption: starttls
  username: !secret emailUser
  password: !secret emailPwd
  recipient:
    - !secret emailTo

script.yaml

frontdoor_camera_motion_email:
  alias: frontdoor_camera_motion_email
  sequence:
  - service: notify.gmail_smtp_email
    data:
      message: ''
      title: Person has been detected at the front door  {{ now().strftime("%-m.%-d.%Y
        %-I:%M:%S %p") }}
      data:
        images:
        - /config/www/tmp/FrontdoorCameraMotionTrigger.jpg
  mode: single
  icon: mdi:email-alert-outline
1 Like

This setup is almost identical to mine.

Yep same port.
Here is a notify: yaml block from my backups from late last year that was working fine for a long time.

  - name: gmail_email_wife
    platform: smtp
    sender: !secret smtp_sendername
    recipient: 
      - !secret smtp_recipient1
#      - !secret smtp_recipient2
      - !secret smtp_recipient3      
    server: smtp.gmail.com
    port: 587
    timeout: 15
    encryption: starttls
    username: !secret gmail_username
    password: !secret gmail_app_password
    sender_name: Home Assistant

This no longer works for me as I said, no emails are sent. I blew those blocks away and rebuilt it, no change, tried using outlook.com service, no different results.
At this point time I’m just going to leave it alone, I’ve spent WAY too long trying in my amateur way to resolve it. At least Telegram notifications are sending the images fine to my phone, that will have to do for now. Thanks guys.

@mr.sneezy do you have 2-step verification turned on?

Not that I can see. I do not need anything but a user & password to login on my PC browser for instance.

Sorry @mr.sneezy my question was vague. In your google account, do you have 2-step verification turned on?