Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. JScript nach Blockly

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    JScript nach Blockly

    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      daPanic last edited by

      Hallöchen,

      ich kann per JS erfolgreich eine Email verschicken. Toll.
      Ich möchte aber gerne die Logik vom Blockly nutzen um vorher meine HTML-Ausgaben mit tollen Daten zu füttern.

      Wie bringe ich ein JS Script ins Blockly?

      Das Script:
      sendTo('email.0', {
      from: 'my@home.de ',
      to: 'dontwritetothis@gmail.com',
      subject: 'Message from ioBroker',
      html: '<p>Embedded image: <img src="cid:HEADER"></p>',
      attachments:[
      {
      path: '/opt/iobroker/iobroker-data/files/0_userdata.0/smarthome_security.png',
      cid: 'HEADER',
      },
      ]
      })

      Codierknecht 1 Reply Last reply Reply Quote 0
      • Codierknecht
        Codierknecht Developer Most Active @daPanic last edited by

        @dapanic sagte in JScript nach Blockly:

        Wie bringe ich ein JS Script ins Blockly?

        Mit einem passend konfigurierten "sendTo"-Block:

        d8e6cea7-f295-4015-9111-7c08c091c8a2-image.png

        D 1 Reply Last reply Reply Quote 0
        • D
          daPanic @Codierknecht last edited by Homoran

          @codierknecht
          Alles klar...
          soweit verstanden und klappt auch, bis auf die Attachments.

          Ein Tipp wie ich

          attachments:[
                  {
                      path: '/opt/iobroker/iobroker-data/files/0_userdata.0/smarthome_security.png',
                      cid: 'HEADER',
                  },
              ]
          

          Als Parameter übergebe? Klar, den Parameter "attachment" definieren, aber was schreibe ich rein. Bisher sind alle versuche gescheiert
          .

          Cannot send email: TypeError: Cannot use 'in' operator to search for 'contentTransferEncoding' in [{path: '/opt/iobroker/iobroker-data/files/0_userdata.0/smarthome_security.png',cid: 'HEADER'}]
          

          MOD-EDIT: Code in code-tags gesetzt!

          Asgothian Codierknecht paul53 3 Replies Last reply Reply Quote 0
          • Asgothian
            Asgothian Developer @daPanic last edited by Asgothian

            @dapanic
            so:
            Screenshot 2025-06-02 at 09.39.53.png

            oder so:
            Screenshot 2025-06-02 at 09.44.22.png

            in der Funktion:

            const rv = {};
            if (path) rv.path = path;
            if (cid) rv.cid = cid;
            return [rv];
            
            1 Reply Last reply Reply Quote 0
            • Codierknecht
              Codierknecht Developer Most Active @daPanic last edited by

              @dapanic

              Nimm mal den anderen Block (email):

              f221cc48-1bc9-46e4-b949-aa930a2729db-image.png

              1 Reply Last reply Reply Quote 0
              • paul53
                paul53 @daPanic last edited by

                @dapanic sagte: "attachment" definieren, aber was schreibe ich rein.

                Blockly_temp.JPG

                D 1 Reply Last reply Reply Quote 1
                • D
                  daPanic @paul53 last edited by

                  @paul53

                  Danke, so klappt es.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  Support us

                  ioBroker
                  Community Adapters
                  Donate

                  905
                  Online

                  31.7k
                  Users

                  79.7k
                  Topics

                  1.3m
                  Posts

                  4
                  7
                  100
                  Loading More Posts
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes
                  Reply
                  • Reply as topic
                  Log in to reply
                  Community
                  Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                  The ioBroker Community 2014-2023
                  logo