Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. [gelöst] Kamerabild per Mail im Body versenden

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    [gelöst] Kamerabild per Mail im Body versenden

    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      Kuddel @MCU last edited by Kuddel

      @MCU funktioniert leider noch nicht.

      Dateiname:

      18.12.2020_06.59_Uhr_Haustuer.jpg
      

      5f27c0a2-2f9b-42e2-9787-f2f74281107c-grafik.png

      M 1 Reply Last reply Reply Quote 0
      • M
        MCU @Kuddel last edited by MCU

        @Kuddel Vergleich mal die beiden Blockly. Was fällt auf? Insbesondere unten bei Dateiname(ootional)?
        cid:file1 muss schon dahin wo ich es hingeschrieben hatte!

        K 1 Reply Last reply Reply Quote 0
        • K
          Kuddel @MCU last edited by

          @MCU bei dir heißt die datei file1 und ich geben den Dateinamen per Variable an.

          Gib mir mal bitte einen Tipp... ich stehe auf dem Schlauch

          M 1 Reply Last reply Reply Quote 0
          • M
            MCU @Kuddel last edited by

            @Kuddel Den Text schreibst du so wie ich es gemacht habe.
            Unten bei Dateiname (optional) kommt dein wert Pfad rein.

            K 1 Reply Last reply Reply Quote 0
            • K
              Kuddel @MCU last edited by

              @MCU oh man, das hab ich gekonnt überlesen. jetzt funktioniert es.

              Danke dir

              M S 2 Replies Last reply Reply Quote 0
              • M
                MCU @Kuddel last edited by MCU

                @Kuddel Vielleicht zur Erklärung:
                Wenn man das Blockly umwandeln lässt in javascript:
                f36ecdae-8564-484c-8598-fc3a8d5e88ef-image.png
                sieht man im Programm als attachment: cid:file1
                nutzt man auch den 2. Dateinamen(optional) wäre das cid:file2, welche man dann als 2. Bild direkt mit verschicken könnte!

                var dateiname;
                
                
                sendTo("email.0", "send", {
                   html: (['<html> <head><title>HTML BILD</title></head>','<body><img src=\'cid:file1\' width=“100%“ ','height=“100%“></body></html>'].join('')),
                   to: 'Deine E-Mail',
                   subject: 'Kamera Bild',
                   attachments:[
                      {path: ('/opt/iobroker/kameras/haustuer/' + String(dateiname)), cid: "file1"},
                    ]
                });
                console.log("email: " + (['<html> <head><title>HTML BILD</title></head>','<body><img src=\'cid:file1\' width=“100%“ ','height=“100%“></body></html>'].join('')));
                

                Nutzt man nur javascript kann man so auch mehrere Bilder direkt verschicken, einfach in den Attachments anhängen und im HTML zuordnen. ({path...,cid:"file3"},{path...,cid:"file4"},usw.)

                1 Reply Last reply Reply Quote 0
                • S
                  SigiMOE @Kuddel last edited by

                  @kuddel Hi, könntest Du bitte deinen kompletten Blockly Export hier reinstellen ? Ich würde dies gerne nachbauen. Vielen lieben Dank

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    MCU @SigiMOE last edited by

                    @sigimoe

                    <xml xmlns="https://developers.google.com/blockly/xml">
                     <variables>
                       <variable id="hB@hh_z,#~k0=Jw%/4$5">dateiname</variable>
                     </variables>
                     <block type="email" id="8LSjp-kCHQk#:EsfZy*U" x="37" y="88">
                       <field name="INSTANCE">.0</field>
                       <field name="IS_HTML">TRUE</field>
                       <field name="LOG">log</field>
                       <value name="TO">
                         <shadow type="text" id="sqzYf*D}3)?,u4`H+B(%">
                           <field name="TEXT">Deine E-Mail</field>
                         </shadow>
                       </value>
                       <value name="TEXT">
                         <shadow type="text" id="?PbQf:jy!rWs`!4,dgl;">
                           <field name="TEXT">&lt;html&gt; &lt;head&gt;&lt;title&gt;HTML BILD&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;img src='cid:file1' width=“100%“ height=“100%“&gt;&lt;/body&gt;&lt;/html&gt;</field>
                         </shadow>
                         <block type="text_join" id="N}ceX`#?ceC=7CU{6_dy">
                           <mutation items="3"></mutation>
                           <value name="ADD0">
                             <block type="text" id="W%#Pitz.rMg#bWdA5[9?">
                               <field name="TEXT">&lt;html&gt; &lt;head&gt;&lt;title&gt;HTML BILD&lt;/title&gt;&lt;/head&gt;</field>
                             </block>
                           </value>
                           <value name="ADD1">
                             <block type="text" id="y/*zOl)ZG-^OI^sy8GF1">
                               <field name="TEXT">&lt;body&gt;&lt;img src='cid:file1' width=“100%“ </field>
                             </block>
                           </value>
                           <value name="ADD2">
                             <block type="text" id="!8774c|9xJqgk%XAYo6)">
                               <field name="TEXT">height=“100%“&gt;&lt;/body&gt;&lt;/html&gt;</field>
                             </block>
                           </value>
                         </block>
                       </value>
                       <value name="SUBJECT">
                         <shadow type="text" id="rf`;nm_O:);F0FI4YR)D">
                           <field name="TEXT">Kamera Bild</field>
                         </shadow>
                       </value>
                       <value name="FILE_1">
                         <block type="text_join" id="=1)#S,,C@OXz1T9:5rG)">
                           <mutation items="2"></mutation>
                           <value name="ADD0">
                             <block type="text" id="Hb/M!mIrMo`n[r@VrVq|">
                               <field name="TEXT">/opt/iobroker/kameras/haustuer/</field>
                             </block>
                           </value>
                           <value name="ADD1">
                             <block type="variables_get" id="dUPa#rXv4$M5QzQtZab1">
                               <field name="VAR" id="hB@hh_z,#~k0=Jw%/4$5">dateiname</field>
                             </block>
                           </value>
                         </block>
                       </value>
                     </block>
                    </xml>
                    

                    S 1 Reply Last reply Reply Quote 0
                    • S
                      SigiMOE @MCU last edited by

                      @mcu sagte in [gelöst] Kamerabild per Mail im Body versenden:

                      <xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="hB@hh_z,#~k0=Jw%/4$5">dateiname</variable> </variables> <block type="email" id="8LSjp-kCHQk#:EsfZyU" x="37" y="88"> <field name="INSTANCE">.0</field> <field name="IS_HTML">TRUE</field> <field name="LOG">log</field> <value name="TO"> <shadow type="text" id="sqzYfD}3)?,u4H+B(%"> <field name="TEXT">Deine E-Mail</field> </shadow> </value> <value name="TEXT"> <shadow type="text" id="?PbQf:jy!rWs!4,dgl;"> <field name="TEXT"><html> <head><title>HTML BILD</title></head><body><img src='cid:file1' width=“100%“ height=“100%“></body></html></field> </shadow> <block type="text_join" id="N}ceX#?ceC=7CU{6_dy"> <mutation items="3"></mutation> <value name="ADD0"> <block type="text" id="W%#Pitz.rMg#bWdA5[9?"> <field name="TEXT">&lt;html&gt; &lt;head&gt;&lt;title&gt;HTML BILD&lt;/title&gt;&lt;/head&gt;</field> </block> </value> <value name="ADD1"> <block type="text" id="y/*zOl)ZG-^OI^sy8GF1"> <field name="TEXT">&lt;body&gt;&lt;img src='cid:file1' width=“100%“ </field> </block> </value> <value name="ADD2"> <block type="text" id="!8774c|9xJqgk%XAYo6)"> <field name="TEXT">height=“100%“&gt;&lt;/body&gt;&lt;/html&gt;</field> </block> </value> </block> </value> <value name="SUBJECT"> <shadow type="text" id="rf;nm_O:);F0FI4YR)D"> <field name="TEXT">Kamera Bild</field> </shadow> </value> <value name="FILE_1"> <block type="text_join" id="=1)#S,,C@OXz1T9:5rG)"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="Hb/M!mIrMo`n[r@VrVq|"> <field name="TEXT">/opt/iobroker/kameras/haustuer/</field> </block> </value> <value name="ADD1"> <block type="variables_get" id="dUPa#rXv4$M5QzQtZab1"> <field name="VAR" id="hB@hh_z,#~k0=Jw%/4$5">dateiname</field> </block> </value> </block> </value> </block> </xml>

                      habe es probiert aber ich klappt noch nicht vermutlich liegt es noch an einer Kleinigkeit

                      Per Telegram klappt es schon mal, aber bei der E-Mail wird das Bild immer noch im Anhang erzeugt und es kommt eine Fehlermeldung, welche ich aber leider nicht interpretieren kann

                      cbd1b74e-b6c1-48ea-b857-a965ba598c45-image.png
                      9393e9b5-e77b-4536-857f-1fd5abdec672-image.png

                      M 1 Reply Last reply Reply Quote 0
                      • M
                        MCU @SigiMOE last edited by MCU

                        @sigimoe
                        Ist denn "dateiname" bei dir überhaupt definiert? Den Teil löschen.
                        Du musst auch eine ID auswählen, sonst nimm den WERT
                        2d48aa87-4094-4af6-a9cf-1ae0b8f05427-image.png

                        35110934-4b55-40fb-a79a-afc3288a123c-image.png
                        Objekt ID und dann WERT auswählen

                        4593d555-e1d0-45ab-b0c7-469e5c74974b-image.png

                        S 1 Reply Last reply Reply Quote 0
                        • S
                          SigiMOE @MCU last edited by

                          @mcu super jetzt klappt es
                          ef80b44f-38eb-44fe-8122-461958eec9c0-image.png

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

                          Support us

                          ioBroker
                          Community Adapters
                          Donate

                          840
                          Online

                          32.0k
                          Users

                          80.5k
                          Topics

                          1.3m
                          Posts

                          3
                          13
                          690
                          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