Jemboy Posted December 5 Posted December 5 (edited) Hi, I am working on an automailer to mail some reoccuring orders automatically. For the mailing part I am using At the end of the e-mail I wanted to add my signature and did this by adding <img src="data:image/png;base64,PLACE_BASE64_HERE" alt="Logo"> to the HTML body. When I receive the e-mail in the image from the signature was not showing. Then I discoverd that Gmail won't show base64 embedded images. As a test I send the same mail to a hotmail account and the logo/image was showing! In the Autoit forum I found the topic below. The script does work, however it will send the "imbedded" image as an attachment. Although the file can not be downloaded (within gmail), ith shows as an attachment in the e-mail list (paperclip icon). I noticed that e-mail send from Outlook with signatures do show in messages delivered into Gmail inboxes, however the image in the signature does NOT show up as attachment. Does anyone now an autoit way to use @mLipok SMTP Mailer UDF with an embedded image that will show in Gmail messages ? Basically sending the signature with an images as Outlook 2021 is doing ? Edited December 5 by Jemboy
SOLVE-SMART Posted December 5 Posted December 5 Hi @Jemboy 👋 , I guess it's not possible. In case gmail has such restrictions that the embedded image (in the email body) cannot be base64 based, then you can only add the image as attachment like you already dicovered on your own. I see no other chance. I am very curious about other opinions ... maybe it can be achieved, but I am very sceptical. Best of luck 🍀 . Best regards Sven Jemboy 1 Stay innovative! Spoiler 🌍 Au3Forums 🎲 AutoIt (en) Cheat Sheet 📊 AutoIt limits/defaults 💎 Code Katas: [...] (comming soon) 🎭 Collection of GitHub users with AutoIt projects 🐞 False-Positives 🔮 Me on GitHub 💬 Opinion about new forum sub category 📑 UDF wiki list ✂ VSCode-AutoItSnippets 📑 WebDriver FAQs 👨🏫 WebDriver Tutorial (coming soon)
Jemboy Posted December 5 Author Posted December 5 expandcollapse popupx-ms-publictraffictype: Email x-ms-traffictypediagnostic: DBBPR05MB6457:EE_|VI1PR05MB10818:EE_ x-ms-office365-filtering-correlation-id: 611272ad-7d3e-46b7-9838-08dd15293fcb x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|366016|1800799024|376014|8096899003|38070700018; x-microsoft-antispam-message-info: b/XF/nTY/oY0ReEcJQbDPLEyGh+af0+qAUk7RmHWXDKBPio10iVHP2YQfihIS0AK9W7ZRURvZESMe/wUUE7BP9RKiW+3Swm2nE53QVotPvM4xqpWLjsIFkD3TfCDSbYrk7PDG94tYf6Bz+ipt6WDaO2G4kuCfNMXqqSDCFE2+yGPQM/phrK2KBcj8VyDo72CD9g8mNwiu/HciUJ1dAI4LgEQxshs28QtM+S/n8rHp+WKpd1IVra4FuZI6Ej+wS8Yl6xi8lcPIwqxiOPeQjPLPoLBVCpHmN1Ui27GZz5QA+G63c3YnmArNpI+VjtCtjz7AVOdNoDN8/XyHp0B2MO5LyCSFx4PR+rsdruqTvMtiv2gfWLM3CfaCMbEhKDBoNaGTbwh5+DfdV6KwQLUb/5IRuLcfgWM1Q1oq6fTs/VY516sgAAGmivPZQwRGnC51yJ9eFgZM6NdDDMj3RDLHHtB84Cu+REDO18xkDPQsos1NttUfWS9HOA5qxPzE2qRJauiEn4KaKlu7yYCZvAvZt+UBNm2cLyQajFX+tEf2DWiuSGaul7lwWgJquELuxCiVurphvUjonG/kJjHREe1MoWAs/GQzZGEo6cYxWZiq9beU3il8GlFqrzH7bqvo7+/PJoLpc2qj9jq+wTwYzHnE1E7MxUEel1w8gF9GpqJhbjNrWdFjNkK1oUxBgzn+ePeCazkU0UeWnMS6WRRvmMypxEHE+ICUBkxIbLD/436Ru8YMO3afQesK1HPcORm93FQ+aN1qJ1o3ejxu5zp6phUExY/w6N4EmBRw5o8IxXKLTh6v06ljkUTSuGC1k0WGyGlHQ7OpNgDk722yX0KO+cLyUdsdJRx2xLZoprrE4I8X+2f5qdbEqPztPfu/OgFJebYUguPEVv4n7NLR8+JH1KULyh+z64K8ZOFfB+vRotTDZRznWFVJTa1GDBCH1cYddUbWA0t+1XhCPfqDia0PmA9ScwVsxkY458/hbtu4YcBZQcIKN5Rc79ACBQJSd/WzZ7Eu6R72umA2oDJkCao59+7YHITQ/ZF0Rn5FqXTZZ/GA1QGJGrOr3AVZo2FqGFsYHX3kxfRl0NckhUVd4RhZcIoNcss18q85Hi6Ji+GJc42I5XUI12AQh48nsVRlyqrkigmtrgNjYtOAAK7qLXIwh5X07ZaVVubJuXuqTiEG4HoNgXGeKXsZFj9nPIEZT4ztYti7UMRfPuWF5IBYT22vjuXL1dY91rFcEg5obZHjXOektri4+Fc5dEj4cYTFz1AJIXphZTMOCEnA1Yk3X0fpSBTf8ra2IP7/nu6utIoI10c+oFVibwRewAphwBlTBW3+0o1l9DiAdZAgYy3jcUYwVYmg4qC/qcWgc6zyqjNWVKz9BIE6J0= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:nl;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DBBPR05MB6457.eurprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(8096899003)(38070700018);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: y6ogdfWnwuHpNR/FRc2MAHHTqLxwiK74kuOqXtQZYpc0/0C79JObFLTSuGRr6OFY5cD8Hb1V5Uh21me1gERQe3w0BQL/L4352UZD9TlMZL2vk8yyIfdZehc/CUuJ7jpIURE5+10U5oa9kvKcz2B8OaX8SIkGW5RTt7J1/sgnfi4axzC2tywnqpt8XFZq7pAx+2Hdb/F+tlKontC25bVJ5xzpSJDeZf6bryfb8yuZE408LMDjMMKm2Jl2prYXkrZY9akrgBP8A838pjFfSsB6oLLwUfHReTz+WGLnF2x7lqnaLXb5wCsCSrig2UEUw/YE+Hp4/pMjVRoN5o3LpJRw4mz+kFG3n9TEBkF+nRfyd0F0Dg2i7RQUWsixd0xk6xSZnNX7spnDGQChl091Ip1EzkTA1LBiWeV4WZ64g/UbgyWtM2kFOFTVxAUe1pnW6xyXPjb78IRjGjNmYrRiQSuBgBPHk9/KIRW/zwsNN9ujLAl7jy5MO/2Fb+KOsXyN8y3TrPw1zWGkMHSAqsO8jn8J598w/yyGekSdlrh4mqCtV+8EjVuwaFsgqWYZt8KlLpqLTUuGziHXcg4CuLPEpHawpbRw+D2F3larFhFxgzikA12u4HTsFzyqR2OgzUBHfClxu/DP7ay3gopfLFUiHGVQn0WanPi2gHP39DKlECYBjhCK5+quUgjkShBVxfkBIuY1KjlCPpQU5XlIeMolSjU+Cm+BDAQN0OdrML8+9/nAvHSCYNcTCshWGp0KjVzX0Pyt9Ob4TnjQFpvlu5KoRsfA2j7sfL9UX5LO2WRycXjc1u6/de8sSN4yr3zcU5nR8jijH9/2QcvghSn2Ty3R3XWfAfDcjI0qrB/55PdhZLJGiJJXPzt0hVDXcz/xEfhN0FFhgeQUoXp76jJlbVihmGdwu1TuU2D8wYYwhCbnXemnBpXaAoN2ZMjK1UGC4uDSVLVVVPWI+kMTgtfPYRmTr3hX5f2wwsnFBz6gSaGohQxumLhnYOyIjQ6j0jOYP3NtR6kT3q5eagpuDx3NLmDhJyc+C1vOq9NfFqRK4HYQBRWMftLKs+haDtoMIUX5iQQY1p7rYv4yFyszQ9qdxxpGrhZgkYLFyPu/o4DJCurjHpWvHEiTJGCdKWuIQq5M+SuUPmWEL6+obEdG8vu8FsuhEtvSodqhcpXFUEumbdeugemVjjP0ZQ99OtB/au2UpHEukVy+/LSVKUl9p7M4+Z03BEfc1TVnZBdvc5GN5nL1zBItQA9hroILviMgXFb34rloujET0IiFRyR+D6FW/FziMgk/IHzHW0tgD2xo7zqijxueAdxjTUXyNb8M97lF/6Rhrkj2XiwmJR97xVg4Lsftq347Tl55LgGvyih77Mke5VvKGPRvC/Uy+1m6rjHABppDX0zVdbcwiJ41W1QbSRJwev2xempTRlhELYhkhwAjTZF6eVJMkbdUhamShvCrqzziEGKIUzJ6fRObsc/H3t5ALxbVNgQrE3vu26fjykLzQyXG7sBS0nzvaAy8i4rd7PYwNftKd4JByGoipMpYUwjfGYJj+RoH4pBQ+Arwp2l00r1a6ug= Content-Type: multipart/related; boundary="_004_DBBPR05MB6457BF03345E282B6FFF6941E6302DBBPR05MB6457eurp_"; type="multipart/alternative" MIME-Version: 1.0 X-OriginatorOrg: aaaa-aaaa.nl X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DBBPR05MB6457.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 611272ad-7d3e-46b7-9838-08dd15293fcb X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Dec 2024 12:35:06.4370 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9774b807-18dd-498e-8052-d166ba8b8cf6 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 86w5I5sP2SVfhPKgZAZt7t+s08SNGHX+o0u9a6HCv1TApwh8Wu1CLrp6/6CvRiu8oil1fEIZkNmINakZY9Myvg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB10818 --_004_DBBPR05MB6457BF03345E282B6FFF6941E6302DBBPR05MB6457eurp_ Content-Type: multipart/alternative; boundary="_000_DBBPR05MB6457BF03345E282B6FFF6941E6302DBBPR05MB6457eurp_" --_000_DBBPR05MB6457BF03345E282B6FFF6941E6302DBBPR05MB6457eurp_ Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable <CUT> bla bla TEXT </CUT> --_000_DBBPR05MB6457BF03345E282B6FFF6941E6302DBBPR05MB6457eurp_ Content-Type: text/html; charset="koi8-r" Content-Transfer-Encoding: quoted-printable <html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr= osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" = xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:= //www.w3.org/TR/REC-html40"> <head> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dkoi8-r"> <meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)"> <!--[if !mso]><style>v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style><![endif]--><style><!-- /* Font Definitions */ @font-face =09{font-family:"Cambria Math"; =09panose-1:2 4 5 3 5 4 6 3 2 4;} @font-face =09{font-family:Calibri; =09panose-1:2 15 5 2 2 2 4 3 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal =09{margin:0cm; =09font-size:11.0pt; =09font-family:"Calibri",sans-serif; =09mso-ligatures:standardcontextual; =09mso-fareast-language:EN-US;} span.E-mailStijl17 =09{mso-style-type:personal-compose; =09font-family:"Calibri",sans-serif; =09color:windowtext;} .MsoChpDefault =09{mso-style-type:export-only; =09mso-fareast-language:EN-US;} @page WordSection1 =09{size:612.0pt 792.0pt; =09margin:70.85pt 70.85pt 70.85pt 70.85pt;} div.WordSection1 =09{page:WordSection1;} --></style><!--[if gte mso 9]><xml> <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext=3D"edit"> <o:idmap v:ext=3D"edit" data=3D"1" /> </o:shapelayout></xml><![endif]--> </head> <body lang=3D"NL" link=3D"#0563C1" vlink=3D"#954F72" style=3D"word-wrap:bre= ak-word"> <div class=3D"WordSection1"> <p class=3D"MsoNormal"><span lang=3D"EN-US">Hoi Martijn <o:p></o:p></span><= /p> <p class=3D"MsoNormal">U vroeg naar een e-mail met text er in<o:p></o:p></p= > <p class=3D"MsoNormal">Bij deze.<o:p></o:p></p> <p class=3D"MsoNormal"><o:p> </o:p></p> <div id=3D"divtagdefaultwrapper"> <div> <div> <div> <div> <div> <div> <div> <p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-family:"Aria= l",sans-serif;mso-ligatures:none;mso-fareast-language:NL">Best Regards= / Meilleurs Salutations,</span><span lang=3D"EN-US" style=3D"mso-ligatures= :none;mso-fareast-language:NL"> </span><span lang=3D"EN-US" style=3D"font-family:"Arial",sans-ser= if;mso-ligatures:none;mso-fareast-language:NL"><br> <br> Mehdi<o:p></o:p></span></p> <p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"mso-ligatures:none;mso= -fareast-language:NL"> </span><span lang=3D"EN-US" style=3D"font-famil= y:"Arial",sans-serif;mso-ligatures:none;mso-fareast-language:NL">= <br> </span><span style=3D"font-size:9.5pt;font-family:"Times New Roman&quo= t;,serif;mso-fareast-language:NL"><img width=3D"338" height=3D"61" style=3D= "width:3.5208in;height:.6354in" id=3D"Afbeelding_x0020_1" src=3D"cid:image0= 01.png@01DB471A.7B3CDE30" alt=3D"Inline afbeelding 1"><span style=3D"mso-li= gatures:none"><o:p></o:p></span></span></p> <p class=3D"MsoNormal"><span style=3D"font-size:12.0pt;font-family:"Ti= mes New Roman",serif;mso-ligatures:none;mso-fareast-language:NL"><br> </span><b><span style=3D"font-family:"Arial",sans-serif;mso-ligat= ures:none;mso-fareast-language:NL">AAAAAAAA B.V.</span></b><b><span style= =3D"font-size:12.0pt;font-family:"Arial",sans-serif;mso-ligatures= :none;mso-fareast-language:NL"><br> <CUT> bla bla </CUT> </div> </div> </div> </div> </div> </div> </div> </div> <p class=3D"MsoNormal"><o:p> </o:p></p> </div> </body> </html> --_000_DBBPR05MB6457BF03345E282B6FFF6941E6302DBBPR05MB6457eurp_-- --_004_DBBPR05MB6457BF03345E282B6FFF6941E6302DBBPR05MB6457eurp_ Content-Type: image/png; name="image001.png" Content-Description: image001.png Content-Disposition: inline; filename="image001.png"; size=17675; creation-date="Thu, 05 Dec 2024 12:35:06 GMT"; modification-date="Thu, 05 Dec 2024 12:35:06 GMT" Content-ID: <image001.png@01DB471A.7B3CDE30> Content-Transfer-Encoding: base64 --_004_DBBPR05MB6457BF03345E282B6FFF6941E6302DBBPR05MB6457eurp_-- Hi @SOLVE-SMART, I asked a co-worker who works with Microsoft mail to send me an e-mail with is signature. My part of the organization uses Gmail Works and his signature with image was viewable in my Gmail. As you can see the first part is some Base64 encoded data and at the end are some Content settings I believe to show the image. In this instance the image is not shown as an attachment by Gmail.
ioa747 Posted December 5 Posted December 5 (edited) you can make a Signature Defaults Create a Gmail signature settings/general Edited December 5 by ioa747 Jemboy 1 I know that I know nothing
water Posted December 5 Posted December 5 (edited) In my OutlookEX UDF I had to do it in two steps: First add the picture as attachment to the mail item, then refer to this attachment in the mail text. The trick is to create an inline picture by using a content id (CID). Please see example 4 from _OL_ItemCreate.au3. Edited December 5 by water Jemboy and SOLVE-SMART 1 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
TheXman Posted December 5 Posted December 5 (edited) 5 hours ago, Jemboy said: Does anyone now an autoit way to use @mLipok SMTP Mailer UDF with an embedded image that will show in Gmail messages ? Is using the SMTP Mailer UDF a hard requirement? If so, I will let someone else figure that out. I don't use the SMTP Mailer UDF. I use my own UDF which is based on the CMail CLI tool. I've used CMail to send emails from AutoIt for several years (2017) and it works quite well. As you can see below, it can handle sending inline images to Gmail recipients (or any other recipients) without any issues. Since CMail is a command line tool, you just need to build the correct command line and execute it. CMail also lets you use configuration files. Using a config file makes building the command line much easier. Image of GMail email sent from AutoIt script using CMail: To point you in the right direction, the CMail parameter for attaching an inline image is "-ai:file". The HTML email then needs to include the following img tag where you want the inline image embedded. In general, to send an inline image in an HTML email, you need to send it as a "multipart/related" MIME type. The content ID (CID) in the img tag tells it which multipart section to embed. The email client, in my case CMail, is responsible for including the file in the correct format. I don't want to get too deep into the weeds of SMTP and MIME types, so if you have additional questions, feel free to ask for more information. <img width="48" height="48" src="cid:BrainAvatar.jpg"> The section below shows the HTML used to send the email from the image above. Near the bottom, you will see img tag with the CID referencing the image to embed. Basically, the "-ai:file" parameter in CMail attaches a "multipart/related" section in the email, which is needed for inline images. Spoiler expandcollapse popup;Sample HTML $sHtml &= '<!DOCTYPE html>' & @CRLF $sHtml &= '<html>' & @CRLF $sHtml &= '<head>' & @CRLF $sHtml &= '<style>' & @CRLF $sHtml &= '<!--' & @CRLF $sHtml &= '/* Font Definitions */' & @CRLF $sHtml &= '@font-face {font-family: "Calibri";}' & @CRLF $sHtml &= @CRLF $sHtml &= '/* Style Definitions */' & @CRLF $sHtml &= 'body {' & @CRLF $sHtml &= 'font-family: "Calibri", "sans-serif";' & @CRLF $sHtml &= ' font-size: 12pt;' & @CRLF $sHtml &= ' }' & @CRLF $sHtml &= 'p {' & @CRLF $sHtml &= 'font-size: 12pt;' & @CRLF $sHtml &= 'font-family: "Calibri", "sans-serif";' & @CRLF $sHtml &= '}' & @CRLF $sHtml &= 'p.Sig {' & @CRLF $sHtml &= 'font-size: 11pt;' & @CRLF $sHtml &= 'font-family: "Calibri", "sans-serif";' & @CRLF $sHtml &= '}' & @CRLF $sHtml &= '-->' & @CRLF $sHtml &= '</style>' & @CRLF $sHtml &= '</head>' & @CRLF $sHtml &= '<body>' & @CRLF $sHtml &= @CRLF $sHtml &= '<p>This is a sample paragraph. It has a few sentences. Like this one.</p>' & @CRLF $sHtml &= '<p>This was sent from a test script.</p>' & @CRLF $sHtml &= @CRLF $sHtml &= '<p class="Sig">' & @CRLF $sHtml &= '__<br>' & @CRLF $sHtml &= '<Redacted><br>' & @CRLF $sHtml &= '<br>' & @CRLF $sHtml &= ' <img width="48" height="48" src="cid:BrainAvatar.jpg"><br>' & @CRLF $sHtml &= '<b><i>"The Xman"</i></b><br>' & @CRLF $sHtml &= '<br>' & @CRLF $sHtml &= '</p>' & @CRLF $sHtml &= @CRLF $sHtml &= '</body>' & @CRLF $sHtml &= '</html>' & @CRLF $sHtml &= @CRLF The relevant lines in the script that set up and sent the email looks like this: Spoiler expandcollapse popup;Mail Variables Local $sServer = "<redacted host name>", _ $iPort = 465, _ $iSecurity = $CM_SECURITY_SSL, _ $sAuthUserName = "<redacted user name>", _ $sAuthPassword = "<redacted password>", _ $sFromAddress = "<redacted email address>:No Reply", _ $sToAddress = "<redacted email address>:TheXman", _ $sSubject = "Inline Image Email Example", _ $sBody = $sHtml, _ $bBodyIsFilePath = False, _ $bBodyContainsHtml = True, _ $sAttachment = "", _ $sCc = "", _ $sBcc = "", _ $sReplyTo = "", _ $iPriority = "", _ $iDsn = $CM_DSN_DEFAULT, _ $bReadReceipt = False, _ $bLog = True, _ $sLogPath = "", _ $sEmbeddedAttachment = "C:\Projects\Personal\AutoIt\_MyIncludes\SMTP\Examples\BrainAvatar.jpg" ;Send a test email _CMail( _ $sServer, _ $iPort, _ $iSecurity, _ $sAuthUserName, _ $sAuthPassword, _ $sFromAddress, _ $sToAddress, _ $sSubject, _ $sBody, _ $bBodyIsFilePath, _ $bBodyContainsHtml, _ $sAttachment, _ $sCc, _ $sBcc, _ $sReplyTo, _ $iPriority, _ $iDsn, _ $bReadReceipt, _ $bLog, _ $sLogPath, _ $sEmbeddedAttachment _ ) This gives you an idea of how it can be done using an alternate method. If you want to stick with your current method, or prefer some other method, please disregard it all together. Edited December 5 by TheXman Correct typos argumentum, Jemboy and SOLVE-SMART 1 2 CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman
mLipok Posted December 5 Posted December 5 (edited) 5 hours ago, Jemboy said: Does anyone now an autoit way to use @mLipok SMTP Mailer UDF with an embedded image that will show in Gmail messages ? Basically sending the signature with an images as Outlook 2021 is doing ? You must send it as HTML not as TEXT and of course you must prepare your HTML to be like a MHT file. I mean the HTML should include image as a base64 encoded string. for example: Quote <link rel="icon" data-savepage-href="https://www.autoitscript.com/images/favicon/favicon-128x128.png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAIAAABMXPacAAAOEUlEQVR4Ae1dBXvsOpJ9P2Zmd Edited December 5 by mLipok typos Jemboy, SOLVE-SMART and argumentum 2 1 Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
Jemboy Posted December 6 Author Posted December 6 @ioa747Thanks for your reply, however my issue is not sending a signature with Gmail, but viewing a signature (send as imbedded base64) with Gmail. @waterVery neat solution, however it looks like I may need to have Outlook installed and configured. The company I work for does not use Outlook. I did try to run _OL_ItemCreate.au3 though and got an error message saying the Testenviroment could not be created. @TheXmanThis CMail is very versatile indeed.🙂 My intent is always (if possible) not to use thirdparty tools. However because of the straight forward implementation, I might switch to CMail in the future if I do not find a simple and workable solution to use @mLipok UDF with an inline image. @mLipokFirst GREAT mail UDF you have created (with credit to @Jos. I have used your UDF several times. E.g. I have an auto server reboot script, which uses your script to e-mail me when it needs to reboot, when it is going to reboot and when the reboot has completed. Your example/quote left me puzzled, it seems like a basic embedded image using base64, but Gmail won't show this type of embedded image. For now I will keep using the example found in this posting https://www.autoitscript.com/forum/topic/132019-imaged-embedded-into-an-email/?do=findComment&comment=1093334 by @TheBlacksheep although it is difficult to wrap in my head😁 My biggest problem for now is, that I have been working at my script on/off for 2 weeks now and I am jeopardizes my other work, so I must complete my script ASAP. I will keep looking for other simple solutions to this problem and may even post them if I find one (in conjuction with mLipok's UDF. Thanks y'ol for your input👍
water Posted December 6 Posted December 6 20 hours ago, water said: The trick is to create an inline picture by using a content id (CID). I didn't want to tell you to use Outlook and my UDF. I just wanted to stress that I once had the same problem and that CID was the solution. TheXman perfectly described how to create the needed HTML mail. Which program you use to send this mail is your choice Jemboy 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
mLipok Posted December 6 Posted December 6 (edited) 1 hour ago, Jemboy said: Your example/quote left me puzzled, it seems like a basic embedded image using base64, but Gmail won't show this type of embedded image. Have you tried this concept yet? Edited December 6 by mLipok Jemboy 1 Signature beginning:* Please remember: "AutoIt"..... * Wondering who uses AutoIt and what it can be used for ? * Forum Rules ** ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Code * for other useful stuff click the following button: Spoiler Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind. My contribution (my own projects): * Debenu Quick PDF Library - UDF * Debenu PDF Viewer SDK - UDF * Acrobat Reader - ActiveX Viewer * UDF for PDFCreator v1.x.x * XZip - UDF * AppCompatFlags UDF * CrowdinAPI UDF * _WinMergeCompare2Files() * _JavaExceptionAdd() * _IsBeta() * Writing DPI Awareness App - workaround * _AutoIt_RequiredVersion() * Chilkatsoft.au3 UDF * TeamViewer.au3 UDF * JavaManagement UDF * VIES over SOAP * WinSCP UDF * GHAPI UDF - modest begining - comunication with GitHub REST API * ErrorLog.au3 UDF - A logging Library * Include Dependency Tree (Tool for analyzing script relations) * Show_Macro_Values.au3 * My contribution to others projects or UDF based on others projects: * _sql.au3 UDF * POP3.au3 UDF * RTF Printer - UDF * XML.au3 UDF * ADO.au3 UDF * SMTP Mailer UDF * Dual Monitor resolution detection * * 2GUI on Dual Monitor System * _SciLexer.au3 UDF * SciTE - Lexer for console pane * Useful links: * Forum Rules * Forum etiquette * Forum Information and FAQs * How to post code on the forum * AutoIt Online Documentation * AutoIt Online Beta Documentation * SciTE4AutoIt3 getting started * Convert text blocks to AutoIt code * Games made in Autoit * Programming related sites * Polish AutoIt Tutorial * DllCall Code Generator * Wiki: * Expand your knowledge - AutoIt Wiki * Collection of User Defined Functions * How to use HelpFile * Good coding practices in AutoIt * OpenOffice/LibreOffice/XLS Related: WriterDemo.au3 * XLS/MDB from scratch with ADOX IE Related: * How to use IE.au3 UDF with AutoIt v3.3.14.x * Why isn't Autoit able to click a Javascript Dialog? * Clicking javascript button with no ID * IE document >> save as MHT file * IETab Switcher (by LarsJ ) * HTML Entities * _IEquerySelectorAll() (by uncommon) * IE in TaskScheduler * IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) * PDF Related: * How to get reference to PDF object embeded in IE * IE on Windows 11 * I encourage you to read: * Global Vars * Best Coding Practices * Please explain code used in Help file for several File functions * OOP-like approach in AutoIt * UDF-Spec Questions * EXAMPLE: How To Catch ConsoleWrite() output to a file or to CMD *I also encourage you to check awesome @trancexx code: * Create COM objects from modules without any demand on user to register anything. * Another COM object registering stuff * OnHungApp handler * Avoid "AutoIt Error" message box in unknown errors * HTML editor * winhttp.au3 related : * https://www.autoitscript.com/forum/topic/206771-winhttpau3-download-problem-youre-speaking-plain-http-to-an-ssl-enabled-server-port/ "Homo sum; humani nil a me alienum puto" - Publius Terentius Afer"Program are meant to be read by humans and only incidentally for computers and execute" - Donald Knuth, "The Art of Computer Programming" , be and \\//_. Anticipating Errors : "Any program that accepts data from a user must include code to validate that data before sending it to the data store. You cannot rely on the data store, ...., or even your programming language to notify you of problems. You must check every byte entered by your users, making sure that data is the correct type for its field and that required fields are not empty." Signature last update: 2023-04-24
argumentum Posted December 6 Posted December 6 3 hours ago, Jemboy said: This CMail is very versatile indeed.🙂 My intent is always (if possible) not to use thirdparty tools 3 hours ago, Jemboy said: I must complete my script ASAP. Use that and call it a day. Actually make the code UDF like and share it here. There. A solution for you and for me too Jemboy 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
Jemboy Posted December 9 Author Posted December 9 On 12/6/2024 at 1:19 PM, mLipok said: Have you tried this concept yet? Yes, I did. First I went to an online website and converted a PNG image to base64. Because this was a lot of text, I saved it to a file logo_base64.txt. In the script, I read the content of the logo_base64.txt into a string. Added the following <img src="data:image/png;base64,PLACE_BASE64_HERE" alt="Logo"> to the HTML-body of before sending the e-mail. I had PLACE_BASE64_HERE replaced by the string with the base64 content. Next I sent the e-mail to a Gmail account and to my private e-mail (an old hotmail.com account). When opening the Gmail, I see the image place holder for half a second before it dissapear and no logo is shown. The hotmail account (outlook.com) just shows the logo in the e-mail. When using https://www.autoitscript.com/forum/topic/132019-imaged-embedded-into-an-email/?do=findComment&comment=1093334 the logo is displayed by both Gmail and Hotmail/Outlook.
Jemboy Posted December 9 Author Posted December 9 On 12/6/2024 at 12:36 PM, water said: I didn't want to tell you to use Outlook and my UDF. I just wanted to stress that I once had the same problem and that CID was the solution. TheXman perfectly described how to create the needed HTML mail. Which program you use to send this mail is your choice Hi water, no bad thought entered my mind. I hold you and others Autoit guru's in the highest esteem😁 Indeed your solution is very nice, but above my level to try to reshape it for my use in a short amount of time. Your are correct about TheXman describing the HTML mail (and adding the image), however this only when using CMail als the e-mail sender. The part creating the Content ID (CID) is completely done internally by CMail. Your UDF is doing this also internally (I presume using an Outlook DLL/object).
Jemboy Posted December 9 Author Posted December 9 On 12/6/2024 at 3:32 PM, argumentum said: Use that and call it a day. Actually make the code UDF like and share it here. There. A solution for you and for me too I don't have enough structure in my life to create enough time to make an UDF. 🙂 However I have posted some projects in the past and I try to format all my replies, so people with the same question or problem could "easily" use my answer to determine how to solve the problem. argumentum 1
water Posted December 9 Posted December 9 51 minutes ago, Jemboy said: The part creating the Content ID (CID) is completely done internally by CMail. Your UDF is doing this also internally (I presume using an Outlook DLL/object). My understanding is that - as the CID part is completely embedded in the HTML that has to be created by you - the mail program (be it Outlook or CMail or ...) is only used to put the HTML mail into an envelope and transmit it. No changes to the HTML will be done by Outlook/CMail. But I could be wrong Jemboy 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Developers Jos Posted December 9 Developers Posted December 9 (edited) Just had a look at this, and something like this change to my UDF will make it work for me. Just use the defined format defining the source file full path in the HTML body: expandcollapse popupGlobal $oMyRet[2] Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") ;################################## ; Include ;################################## #include <file.au3> ;################################## ; Variables ;################################## $SmtpServer = "smtp.gmail.com" ; address for the smtp-server to use - REQUIRED $FromName = "Jos" ; name from who the email was sent $FromAddress = "j....@gmail.com" ; address from where the mail should come $ToAddress = "j....@gmail.com" ; destination address of the email - REQUIRED $Subject = "Test Gmail message with inline images" ; subject from the email - can be anything you want it to be $Body = "<body> test email with 2 images inline:<br>" & _ "first image: ##image#'C:\path-to-file\image1.png'##" & _ "second image: ##image#C:\path-to-file\image2.png##" & _ "<br></body>" ; the messagebody from the mail - can be left blank but then you get a blank mail $AttachFiles = "" ; the file you want to attach- leave blank if not needed $CcAddress = "" ; address for cc - leave blank if not needed $BccAddress = "" ; address for bcc - leave blank if not needed $Importance = "Normal" ; Send message priority: "High", "Normal", "Low" $Username = "j....@gmail.com" ; username for the account used from where the mail gets sent - REQUIRED $Password = "--your password --" ; password for the account used from where the mail gets sent - REQUIRED $IPPort = 465 ; GMAIL port used for sending the mail $ssl = 1 ; GMAIL enables/disables secure socket layer sending - put to 1 if using httpS $tls = 0 ; enables/disables TLS when required ;~ $SmtpServer = "smtp.gmail.com" ; GMAIL address for the smtp-server to use - REQUIRED ;~ $IPPort=465 ; GMAIL port used for sending the mail ;~ $ssl=1 ; GMAIL enables/disables secure socket layer sending - put to 1 if using httpS ;~ $SmtpServer = "smtp.office365.com" ; O365 address for the smtp-server to use - REQUIRED ;~ $IPPort=25 ; O365 port used for sending the mail ;~ $ssl=1 ; O365 enables/disables secure socket layer sending - put to 1 if using httpS ;~ SmtpServer = "smtp.mail.yahoo.com" ; Yahoo address for the smtp-server to use - REQUIRED ;~ $IPPort = 465 ; Yahoo port used for sending the mail ;~ $ssl = 1 ; Yahoo enables/disables secure socket layer sending - put to 1 if using httpS ;################################## ; Script ;################################## Global $oMyRet[2] Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl, $tls) If @error Then MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc) EndIf ; ; The UDF Func _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject = "", $as_Body = "", $AttachFiles = "", $CcAddress = "", $BccAddress = "", $Importance = "Normal", $Username = "", $Password = "", $IPPort = 25, $ssl = 0, $tls = 0) Local $objEmail = ObjCreate("CDO.Message") ; convert the Fromname to UTF-8 basex64 to allow for UTF characters in the name If $FromName <> "" Then $FromName = "=?utf-8?B?" & _Base64Encode(BinaryToString(StringToBinary($FromName, 4), 1)) & '?=' $objEmail.From = '"' & $FromName & '" <' & $FromAddress & '>' $objEmail.To = $ToAddress Local $i_Error = 0 Local $i_Error_desciption = "" If $CcAddress <> "" Then $objEmail.Cc = $CcAddress If $BccAddress <> "" Then $objEmail.Bcc = $BccAddress $objEmail.Subject = $Subject If StringInStr($as_Body, "<") And StringInStr($as_Body, ">") Then ; add embedded images when defined Local $aImages = 0, $iImgCnt = 0 $aImages = StringRegExp($as_Body, "##image#['""]?([^#'""]*)['""]?##", $STR_REGEXPARRAYGLOBALMATCH) $iImgCnt += 1 For $i = 0 To UBound($aImages) - 1 $iImgCnt += 1 $fileext = StringRegExpReplace($aImages[$i], ".*(\.+.*)", "$1") $as_Body = StringRegExpReplace($as_Body, "(##image#['""]?([^#'""]*)['""]?##)", "<img src=" & $iImgCnt & $fileext & ">", 1) $objBP = $objEmail.AddRelatedBodyPart($aImages[$i], $iImgCnt & $fileext, 1) $objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = "<" & $iImgCnt & $fileext & ">" $objBP.Fields.Update ConsoleWrite('+> Image placed inline: ' & $aImages[$i] & @LF) Next $objEmail.HTMLBody = $as_Body $objEmail.HTMLBodyPart.CharSet = "UTF-8" Else $objEmail.Textbody = $as_Body & @CRLF $objEmail.TextBodyPart.CharSet = "UTF-8" EndIf If $AttachFiles <> "" Then Local $Files2Attach = StringSplit($AttachFiles, ";") For $x = 1 To $Files2Attach[0] $Files2Attach[$x] = _PathFull($Files2Attach[$x]) If FileExists($Files2Attach[$x]) Then ConsoleWrite('+> File attachment added: ' & $Files2Attach[$x] & @LF) $objEmail.AddAttachment($Files2Attach[$x]) Else ConsoleWrite('!> File not found to attach: ' & $Files2Attach[$x] & @LF) SetError(1) Return 0 EndIf Next EndIf $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $SmtpServer If Number($IPPort) = 0 Then $IPPort = 25 $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort ;Authenticated SMTP If $Username <> "" Then $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = $Username $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $Password EndIf ; Set security params If $ssl Then $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True If $tls Then $objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendtls") = True ;Update settings $objEmail.Configuration.Fields.Update ; Set Email Importance Switch $Importance Case "High" $objEmail.Fields.Item("urn:schemas:mailheader:Importance") = "High" Case "Normal" $objEmail.Fields.Item("urn:schemas:mailheader:Importance") = "Normal" Case "Low" $objEmail.Fields.Item("urn:schemas:mailheader:Importance") = "Low" EndSwitch $objEmail.Fields.Update ; Sent the Message $objEmail.Send If @error Then SetError(2) Return $oMyRet[1] EndIf $objEmail = "" EndFunc ;==>_INetSmtpMailCom ; ; ; Com Error Handler Func MyErrFunc() $HexNumber = Hex($oMyError.number, 8) $oMyRet[0] = $HexNumber $oMyRet[1] = StringStripWS($oMyError.description, 3) ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF) SetError(1) ; something to check for when this function returns Return EndFunc ;==>MyErrFunc ; Base64 UDF made by Trancexx https://www.autoitscript.com/forum/topic/84133-winhttp-functions/?do=findComment&comment=1260746 Func _Base64Encode($vInput) Local Const $CRYPT_STRING_BASE64 = 0x00000001 Local Const $CRYPT_STRING_NOCRLF = 0x40000000 $vInput = Binary($vInput) Local $tInput = DllStructCreate("byte[" & BinaryLen($vInput) & "]") DllStructSetData($tInput, 1, $vInput) Local $aCall = DllCall("Crypt32.dll", "bool", "CryptBinaryToStringA", _ "struct*", $tInput, _ "dword", DllStructGetSize($tInput), _ "dword", $CRYPT_STRING_BASE64 + $CRYPT_STRING_NOCRLF, _ "ptr", 0, _ "dword*", 0) If @error Or Not $aCall[0] Then Return SetError(1, 0, "") ; error calculating the length of the needed buffer Local $tOut = DllStructCreate("char[" & $aCall[5] & "]") $aCall = DllCall("Crypt32.dll", "int", "CryptBinaryToStringA", _ "struct*", $tInput, _ "dword", DllStructGetSize($tInput), _ "dword", $CRYPT_STRING_BASE64 + $CRYPT_STRING_NOCRLF, _ "struct*", $tOut, _ "dword*", DllStructGetSize($tOut)) If @error Or Not $aCall[0] Then Return SetError(2, 0, "") ; error encoding Return DllStructGetData($tOut, 1) EndFunc ;==>_Base64Encode Edited December 11 by Jos updated code SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Jemboy Posted December 10 Author Posted December 10 19 hours ago, water said: My understanding is that - as the CID part is completely embedded in the HTML that has to be created by you - the mail program (be it Outlook or CMail or ...) is only used to put the HTML mail into an envelope and transmit it. No changes to the HTML will be done by Outlook/CMail. But I could be wrong expandcollapse popup</span><span style=3D"font-size:9.5pt;font-family:"Times New Roman&quo= t;,serif;mso-fareast-language:NL"><img width=3D"338" height=3D"61" style=3D= "width:3.5208in;height:.6354in" id=3D"Afbeelding_x0020_1" src=3D"cid:image0= 01.png@01DB471A.7B3CDE30" alt=3D"Inline afbeelding 1"><span style=3D"mso-li= gatures:none"><o:p></o:p></span></span></p> <p class=3D"MsoNormal"><span style=3D"font-size:12.0pt;font-family:"Ti= mes New Roman",serif;mso-ligatures:none;mso-fareast-language:NL"><br> </span><b><span style=3D"font-family:"Arial",sans-serif;mso-ligat= ures:none;mso-fareast-language:NL">Test Ltd.</span></b><b><span style= =3D"font-size:12.0pt;font-family:"Arial",sans-serif;mso-ligatures= :none;mso-fareast-language:NL"><br> </span></b><span style=3D"font-size:9.0pt;font-family:"Arial",san= s-serif;mso-ligatures:none;mso-fareast-language:NL">50 Sevillatoad<br> WC2N London<br> Phone: +44 (0)20 555 4469<br> <a href=3D"mailto:peter@testltd.co.uk"><span style=3D"color:blue">peter@test ltd.co.uk</span></a><br> <a href=3D"mailto:info@free-parts.nl"><span style=3D"color:blue">info@testlt d.co.uk</span></a> =94 <a href=3D"http://www.testltd.co.uk.nl"><span style=3D"color:blue">www.testl td.co.uk</span></a><br> Chambers of commerce no: 123025676<u> </u>BTW / VAT= : UK55530.73.222.W02</span><span style=3D"mso-ligatures:none;mso-fareast-lan= guage:NL"><o:p></o:p></span></p> </div> </div> </div> </div> </div> </div> </div> </div> <p class=3D"MsoNormal"><o:p> </o:p></p> </div> </body> </html> --_000_DBBPR05MB6457BF03345E282B6FFF6941E6302DBBPR05MB6457eurp_-- --_004_DBBPR05MB6457BF03345E282B6FFF6941E6302DBBPR05MB6457eurp_ Content-Type: image/png; name="image001.png" Content-Description: image001.png Content-Disposition: inline; filename="image001.png"; size=17675; creation-date="Thu, 05 Dec 2024 12:35:06 GMT"; modification-date="Thu, 05 Dec 2024 12:35:06 GMT" Content-ID: <image001.png@01DB471A.7B3CDE30> Content-Transfer-Encoding: base64 iVBORw0KGgoAAAANSUhEUgAAAVIAAAA9CAYAAAD/AOHUAAAgAElEQVR4Ae19d3yUxfP/JKQ3EiCN mtB7C71Z6FKk2EDBCipYUFHBgiIoiooNFREBUVTE9hEpgoAU6b2E3ltCCSUhpHK/93sve3nucpdc cpd8//hleJF7ypZ5ZndnZ2ZnZz1MACmFUgqUUqCUAqUUKDIFPIucszRjKQVKKVBKgVIKKAp4FYUO k997T954e5KYxEOkpAVaT0+Ja9xIVvyzVHx9fRX6e/fulT5975SzFy4VPz4eHlK/ZozMm/ez1KpV q9Dk+/PPP+XLqVNlzZZtkpWVBXwLXUTBGUCj5o0aysrlyyw0cpTpjz/+kC8/nyprt2yX7OzsYsOn dbNmsmzpYvHx8VGo7N6zR/qizZLOnSsWEth+b030mfk//Cg1alS3fWW5nzR5skwa/5bIzZuWZ+66 KOPlJbd06y4Tx78hDRs2dKrYq1evSu/+/WXn+g1OpXc1UVhkpEyb9qX07NEjT1HJyckS16KVJJw8 @waterNeither I am. 🙂 The above is part of the source code of an e-mail I received. On the end of the third line you can finf: src=3D"cid:image0= 01.png@01DB471A.7B3CDE30" , I believe this has to match with the line Content-ID: <image001.png@01DB471A.7B3CDE30> (just a few lines above the base64 data). The base64 data (just took part of it as an example) must be created by converting the image. Their must some kind of module in both CMail and Outlook to convert the image to base64.....
Jemboy Posted December 10 Author Posted December 10 @JosTried your code but is not working for me.🤕🙂 What I did: replaced the credentials with my own replaced the image part HTML with the following: Local $as_Body = "<body> test email with 2 images inline:<br>" & _ "first image: ::image:" & @ScriptDir & "\image001.png" & "::" & _ "second image: ::image:" & @ScriptDir & "\image002.png" & "::" & _ "<br></body>" and added the image001 and 002 to my @scriptdir. replaced all jpg in your script with png. I do receive the e-mail but without any images. It probably has something to do with StringRegExp but I have never really understand StringRegExp very much.
Nine Posted December 10 Posted December 10 In @Jos code the image path is surrounded with single quotes. In yours, there is none. IDK if that will make it work for you... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy
Developers Jos Posted December 10 Developers Posted December 10 1 hour ago, Jemboy said: "first image: ::image:" & @ScriptDir & "\image001.png" & "::" The EXACT format the regex will search for in my example script is indeed: ::image:'Image file path/name':: ..and you can't deviate from that! I think I will add this to the standard UDF be am open to suggestion for a "better" format. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now