Bam Posted August 18, 2011 Share Posted August 18, 2011 Kinda just need pointed in the right direction / can it be done with auto it.Im looking for a way to embed an image into an email, I've done alot of searching and I guess the way to do it is with cid: after attaching the image to the email but Ive tried this with the outlook udfs already with no joy.I found a python script that I found that does what I want but I never have used python until today.I've also used a data URI (Im not sure what its called, this site can convert an image into text and then then you just insert the text into <img src="LengthyStringHereGeneratedBySite">), This does work if the email is opened with Thunderbird or other email clients but if opened with gmail theirs just a plank spot where the image should be.It would be awesome if it could be done with out outlook but I still prefer using AutoIt with outlook vrs learning python.Any help is appreciative. Link to comment Share on other sites More sharing options...
pieeater Posted August 18, 2011 Share Posted August 18, 2011 here's an to an _INetSmtpMailCom() function made by jos with attatchment capabilitys [spoiler]My UDFs: Login UDF[/spoiler] Link to comment Share on other sites More sharing options...
Bam Posted August 18, 2011 Author Share Posted August 18, 2011 Thanks for the reply. Ive tried that before but Im not trying to add an image as a attachment Im trying to make it show up as part of the email. Link to comment Share on other sites More sharing options...
Bam Posted August 18, 2011 Author Share Posted August 18, 2011 Well have jury rigged solution, using the python script and$File = FileOpen(@ScriptDir & "\bam-mail.py") $Data = FileRead($File) FileClose($File) $Data = StringReplace($Data, "#@email.com", "to@emailadress") $File = FileOpen(@ScriptDir & "\bam-mailA.py", 2) FileWrite($File, $Data) FileClose($File) $Run = RunWait("C:\Python32\python.exe C:\Users\Bam\Desktop\Python\bam-mailA.py","") MsgBox(1,1,$Run)Still open to any other AutoIt solutions. Link to comment Share on other sites More sharing options...
water Posted August 19, 2011 Share Posted August 19, 2011 (edited) You could try my OutlookEX UDF (for download please see my signature).Function _OL_ItemAttachmentAdd allows to specify the position where to insert the attachment if the mail body is of type RTF.Example 3 in the _OL_ItemAttachmentAdd.au3 file will give you an idea how it could work.I have to admit that I haven't yet made it working but according to the M$ docu it should be possible.If you like I can do some testing.Edit:Can you run the Python script so we can see how the HTML mail looks like?Edit 2:I think I found an example that let's you do what you want using HTML. I will have to test it as soon as I'm in my office again. Edited August 19, 2011 by water 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 Link to comment Share on other sites More sharing options...
Bam Posted August 19, 2011 Author Share Posted August 19, 2011 Thanks for the response. <b>Some <i>HTML</i> text</b> and an image.<br><img src="cid:image1"><br>Nifty! is the html part, the cid:image1 part is what im mainly interested in. It seems to pull the picture from the attachments and displays the picture in the message with out having to view it in attachments or show remote content. I also like that it includes a plain text version of the email. Here's the source of the email if that's what you where looking for. (had to shorten the image data, was too long and the code tags didn't like it ) expandcollapse popupContent-Type: multipart/related; boundary="===============1827817307==" MIME-Version: 1.0 Subject: Subject From: email@address.com To: email@address.com Message-ID: <################@####.#######.###> Date: Fri, 19 Aug 2011 13:34:21 -0500 (CDT) X-Sendgrid-EID: AH77f4+342/dscWd6jTxVQ6eWP508CuYzOjTWDheTB57KzaG05LaWcPnpnIq7zsmBdJNYYzUPRdGh66xDl6LTpwttsAvjcnSA+IXh/0jCRrnsdV3uYgcvDcpSybQhVLOi9uMOymGx9mehYPOAj+LcSl7cBfhnf8gPLxA1Ul+Brk= Sender: Bam=##############@#######.### This is a multi-part message in MIME format. --===============1827817307== Content-Type: multipart/alternative; boundary="===============1877621409==" MIME-Version: 1.0 --===============1877621409== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit This is the alternative plain text message. --===============1877621409== Content-Type: text/html; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit <b>Some <i>HTML</i> text</b> and an image.<br><img src="cid:image1"><br>Nifty! --===============1877621409==-- --===============1827817307== Content-Type: image/png MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-ID: <image1> iVBORw0KGgoAAAANSUhEUgAAASwAAAELCAIAAADstiysAAAACXBIWXMAAAsS yKomG8t9ZSFqVdWFngjpQqhbJJVZUU0c/QvZiEqKXcy/ywAAAABJRU5ErkJg gg== --===============1827817307==-- Link to comment Share on other sites More sharing options...
water Posted August 19, 2011 Share Posted August 19, 2011 (edited) The "cid:" thing is what I've found on the net too and what seems to be the solution. The problem is how to tell Outlook what to do!Here is the sample code which I need to translate to AutoIt: http://help.wugnet.com/office/embed-image-Outlook-Message-VBA-ftopict1172044.htmlEdit: Unfortunately this code example uses CDO which is no longer available on Outlook 2007 systems or later. It has to be downloaded and installed on every computer running Outlook. Edited August 20, 2011 by water 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 Link to comment Share on other sites More sharing options...
water Posted August 20, 2011 Share Posted August 20, 2011 (edited) Here is an example that works with my OutlookEX UDF. Make sure the file "The_Outlook.JPG" is in the same directory as the script.#include <OutlookEx.au3> $oOutlook = _OL_Open() $oMail = _OL_ItemCreate($oOutlook, $olMailItem, "*", "", "Subject=TestMail", "BodyFormat=" & $olFormatHTML, _ 'HTMLBody=This is a picture.<img src="cid:The_Outlook.jpg">This is more text.') If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemCreate Example Script", "Error creating a mail item. @error = " & @error & ", @extended = " & @extended) $oItem = _OL_ItemAttachmentAdd($oOutlook, $oMail, Default, @ScriptDir & "\The_Outlook.JPG") If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemCreate Example Script", "Error adding an attachment to the mail item. @error = " & @error & ", @extended = " & @extended) $oMail.Display _OL_Close($oOutlook)The same is valid for a background image. The code was found here at the end of the page. Edited August 20, 2011 by water 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 Link to comment Share on other sites More sharing options...
Bam Posted August 22, 2011 Author Share Posted August 22, 2011 When it displays the email it look awesome just they way it should but I cant seem to find a way to add an email address to send the email to and how to send it. Also is there any to have a plain text version of the email with an html version? (I know the plain text wont be able to show the image but I'm just curious) Link to comment Share on other sites More sharing options...
water Posted August 22, 2011 Share Posted August 22, 2011 Use _OL_ItemRecipientAdd to add a recipient and _OL_ItemSend to send the mail. To create a plain text mail you have to use:$oMail = _OL_ItemCreate($oOutlook, $olMailItem, "*", "", "Subject=TestMail", "BodyFormat=" & $olFormatPlain, 'Body=This is plain text.') 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 Link to comment Share on other sites More sharing options...
KaFu Posted August 22, 2011 Share Posted August 22, 2011 How about using this to create a mail with CDO and using this AddRelatedBodyPart http://msdn.microsoft.com/en-us/library/ms526569%28v=exchg.10%29.aspx to add the resource? OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
water Posted August 22, 2011 Share Posted August 22, 2011 (edited) _INetSmtpMailCom() doesn't support embedded pictures and CDO is no longer a part of Office 2007 and 2010 (it can be downloaded separately but I don't know if it is supported any longer).Edit: CDO is no longer supported for Outlook 2010. Edited August 22, 2011 by water 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 Link to comment Share on other sites More sharing options...
KaFu Posted August 22, 2011 Share Posted August 22, 2011 _INetSmtpMailCom() doesn't support embedded picturesYep, that's why I referred to the AddRelatedBodyPart method which needs to be in-cooperated into the _INetSmtpMailCom() function. Here's another snippet I found: #cs Const CdoReferenceTypeName = 1 Dim objCDO, objBP Set objCDO = Server.CreateObject("CDO.Message") objCDO.MimeFormatted = True objCDO.To = "you@yourdomain.com" objCDO.From = "you@yourdomain.com" objCDO.Subject = "Embedded image demo" objCDO.HTMLBody = "<html>Check this out: <img src=""cid:myimage.gif""></html>" ' Here's the good part, thanks to some little-known members. ' This is a BodyPart object, which represents a new part of the multipart MIME-formatted message. ' Note you can provide an image of ANY name as the source, and the second parameter essentially ' renames it to anything you want. Great for giving sensible names to dynamically-generated images. Set objBP = objCDO.AddRelatedBodyPart(Server.MapPath("/images/myimage.gif"), "myimage.gif", CdoReferenceTypeName) ' Now assign a MIME Content ID to the image body part. ' This is the key that was so hard to find, which makes it ' work in mail readers like Yahoo webmail & others that don't ' recognise the default way Microsoft adds it's part id's, ' leading to "broken" images in those readers. Note the ' < and > surrounding the arbitrary id string. This is what ' lets you have SRC="cid:myimage.gif" in the IMG tag. objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = "<myimage.gif>" objBP.Fields.Update objCDO.Send #ce and CDO is no longer a part of the Windows operating system (it can be downloaded separately but I don't know if it is supported any longer). Really? Seems to work on my Win7-64bit (Ultimate) though. OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Bam Posted August 22, 2011 Author Share Posted August 22, 2011 (edited) #include <OutlookEx.au3> $Email = "email@address.w/e" $oOutlook = _OL_Open() $oMail = _OL_ItemCreate($oOutlook, $olMailItem, "*", "", "Subject=TestMail", "BodyFormat=" & $olFormatHTML, _ 'HTMLBody=This is a picture.<img src="cid:The_Outlook">This is more text.') If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemCreate Example Script", "Error creating a mail item. @error = " & @error & ", @extended = " & @extended) $oItem = _OL_ItemAttachmentAdd($oOutlook, $oMail, Default, @ScriptDir & "\The_Outlook.JPG") If @error <> 0 Then Exit MsgBox(16, "OutlookEX UDF: _OL_ItemCreate Example Script", "Error adding an attachment to the mail item. @error = " & @error & ", @extended = " & @extended) _OL_ItemRecipientAdd($oOutlook, $oMail, Default,$olTo,$Email) _OL_ItemSend($oOutlook, $oItem, Default) _OL_Close($oOutlook) I just tried the code above and when I received the email the picture didn't show up in the message but it was in attachments. Email MIME (I think its the MIME) from script: ------=_NextPart_000_0007_01CC60D8.D75954A0 Content-Type: image/jpeg; name="The_Outlook.jpg" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="The_Outlook.jpg" I think the problem is it doesn't have the "Content-ID:" wich is in the source of the email from the python script. --===============1827817307== Content-Type: image/png MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-ID: <image1> Edited August 22, 2011 by Bam Link to comment Share on other sites More sharing options...
water Posted August 22, 2011 Share Posted August 22, 2011 Edited post CDO is no longer part of Office 2007 and 2010 (not Windows as I have written before). Added a link for Office 2010 regarding support. 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 Link to comment Share on other sites More sharing options...
water Posted August 23, 2011 Share Posted August 23, 2011 Hi Bam,I've taken the code from here. Maybe it explains why you see the image as an attachment and not included.Or you could try the 2nd example at the bottom of the page. Maybe this works more reliable. 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 Link to comment Share on other sites More sharing options...
TheBlacksheep Posted July 6, 2013 Share Posted July 6, 2013 Hi - apologies for re-opening an old thread but I appear to have got this working on the _INetSmtpMailCom UDF function (which uses CDO and which will be deprecated at some point) - it maybe useful to someone; expandcollapse popupOpt("MustDeclareVars", 1) ;################################## ; Include ;################################## #include <Inet.au3> #Include<file.au3> ;################################## ; Variables ;################################## local $SmtpServer = "mail server name" ; address for the smtp-server to use - REQUIRED local $FromName = "from name" ; name from who the email was sent local $FromAddress = "from address" ; address from where the mail should come local $ToAddress = "from address"; ; destination address of the email - REQUIRED local $CcAddress = "" ; address for cc - leave blank if not needed local $BccAddress = "" ; address for bcc - leave blank if not needed local $Importance = "Normal" ; Send message priority: "High", "Normal", "Low" local $Username = "username@server.com" ; username for the account used from where the mail gets sent - REQUIRED local $Password = "password" ; password for the account used from where the mail gets sent - REQUIRED ;$IPPort = 25 ; port used for sending the mail local $IPPort=465 ; GMAIL port used for sending the mail local $ssl=1 ; GMAIL enables/disables secure socket layer sending - put to 1 if using httpS local $Subject = "Embedded Image Test!!!" local $Body = "<h1>Embedded Image test</h1>" local $AttachFiles = "c:\image1.png;c:\image2.png;c:\image3.png" Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0, $embed = True) Local $objEmail = ObjCreate("CDO.Message") Local $objBP Local $szDrive, $szDir, $szFName, $szExt $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>' $objEmail.To = $s_ToAddress Local $i_Error = 0 Local $i_Error_desciption = "" If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress $objEmail.Subject = $s_Subject $objEmail.MimeFormatted = $embed If $s_AttachFiles <> "" Then Local $S_Files2Attach = StringSplit($s_AttachFiles, ";") For $x = 1 To $S_Files2Attach[0] $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x]) If FileExists($S_Files2Attach[$x]) Then if $embed = True Then _PathSplit($S_Files2Attach[$x], $szDrive, $szDir, $szFName, $szExt) $as_Body &= "<img src=""cid:" & $szFName & $szExt & """>" $objBP = $objEmail.AddRelatedBodyPart($S_Files2Attach[$x], $szFName & $szExt, 1) $objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = "<" & $szFName & $szExt & ">" $objBP.Fields.Update Else $objEmail.AddAttachment($S_Files2Attach[$x]) EndIf Else ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF) SetError(1) Return 0 EndIf Next EndIf If (StringInStr($as_Body, "<") And StringInStr($as_Body, ">")) or ($embed = True) Then $objEmail.HTMLBody = $as_Body Else $objEmail.Textbody = $as_Body & @CRLF EndIf $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer If Number($IPPort) = 0 then $IPPort = 25 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort ;Authenticated SMTP If $s_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") = $s_Username $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password EndIf If $ssl Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True EndIf ;Update settings $objEmail.Configuration.Fields.Update ; Set Email Importance Switch $s_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 _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl, true) Exit just added the bits relevant to this url; http://support.jodohost.com/threads/tut-how-to-add-embedded-images-in-cdo-mail.7692/ it automatically adds the inline images to the body of the email in the order they were attached - if this isn't what you want (because you need to control the html that's being generated) then comment out the bit where it adds to the body and add it manually outside the function. TheBlackSheep Link to comment Share on other sites More sharing options...
Tjalve Posted February 28, 2014 Share Posted February 28, 2014 (edited) I remade the _INetSmtpMailCom in (more or less) the same way as TheBlackSheep did. And everything works fine for ALL mailclients except for Apple. This is a problem since we use IOS devices. So is thaere a way to make this work on Apples mailclient? Edited February 28, 2014 by Tjalve Link to comment Share on other sites More sharing options...
water Posted February 28, 2014 Share Posted February 28, 2014 Hi Tjalve, what do you mean by "does not work"? Do you get an error message? No pictures at all? Wrong position of the picture? ...? 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 Link to comment Share on other sites More sharing options...
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