HighlanderSword Posted March 30, 2015 Share Posted March 30, 2015 Correct Link to comment Share on other sites More sharing options...
water Posted March 30, 2015 Author Share Posted March 30, 2015 Looks good. Could you please add the following line to your script so we get better error information? _OL_ErrorNotify(2) My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki  Link to comment Share on other sites More sharing options...
HighlanderSword Posted March 30, 2015 Share Posted March 30, 2015 Outlook udf version =1.0.0 @Autoitversion =3.3.12.0 @Autoitx64=0 @compiled =0 @osarch=x64 @osversion=win_7 Scriptline = 4065 NumberHex = 80020009 numer = -2147352567 WinDescription = Exception occured Description = Outlook does not recognize one or more names Source = Microsoft Outlook Helpfile = HelpContext =0 LastDllerror =0 Link to comment Share on other sites More sharing options...
water Posted March 30, 2015 Author Share Posted March 30, 2015 Strange. I will have a look at it tomorrow. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki  Link to comment Share on other sites More sharing options...
HighlanderSword Posted April 1, 2015 Share Posted April 1, 2015 Hello Water, Any Luck re-searching my issue ? Link to comment Share on other sites More sharing options...
water Posted April 1, 2015 Author Share Posted April 1, 2015 Function _OL_ItemRecipientAdd has a bug. Could you please replace the function in the UDF with the fixed version? expandcollapse popup; #FUNCTION# ==================================================================================================================== ; Name ..........: _OL_ItemRecipientAdd ; Description ...: Adds one or multiple recipients to an item and resolves them. ; Syntax.........: _OL_ItemRecipientAdd($oOL, $vItem, $sStoreID, $iType, $vP1 = ""[, $vP2 = ""[, $vP3 = ""[, $vP4 = ""[, $vP5 = ""[, $vP6 = ""[, $vP7 = ""[, $vP8 = ""[, $vP9 = ""[, $vP10 = ""[, $bAllowUnresolved = True]]]]]]]]]]) ; Parameters ....: $oOL - Outlook object returned by a preceding call to _OL_Open() ; $vItem - EntryID or object of the item item ; $sStoreID - StoreID where the EntryID is stored. Use the keyword "Default" to use the users mailbox ; $iType - Integer representing the type of recipient. For details see Remarks ; $vP1 - Recipient to add to the item. Either a recipient object or the recipients name to be resolved ; +or a zero based one-dimensional array with unlimited number of recipients (name or object) ; $vP2 - Optional: recipient to add to the item. Either a recipient object or the recipients name to be resolved ; $vP3 - Optional: Same as $vP2 ; $vP4 - Optional: Same as $vP2 ; $vP5 - Optional: Same as $vP2 ; $vP6 - Optional: Same as $vP2 ; $vP7 - Optional: Same as $vP2 ; $vP8 - Optional: Same as $vP2 ; $vP9 - Optional: Same as $vP2 ; $vP10 - Optional: Same as $vP2 ; $bAllowUnresolved - Optional: True doesn't return an error even when unresolvable SMTP addresses have been found (default = True) ; Return values .: Success - Item object ; Failure - Returns 0 and sets @error: ; |1 - No item specified ; |2 - Item could not be found. EntryID might be wrong ; |5 - $iType is missing or not a number ; |3nn - Error adding recipient to the item. @extended = error code returned by the Recipients.Add method, nn = number of the invalid recipient (zero based) ; |4nn - Recipient name could not be resolved. @extended = error code returned by the Resolve method, nn = number of the invalid recipient (zero based) ; |6nn - Recipient object could not be created. @extended = error code returned by the CreateRecipient method, nn = number of the invalid recipient (zero based) ; Author ........: water ; Modified.......: ; Remarks .......: $vP2 to $vP10 will be ignored if $vP1 is an array of recipients ; + ; Valid $iType parameters: ; MailItem recipient: one of the following OlMailRecipientType constants: olBCC, olCC, olOriginator, or olTo ; MeetingItem recipient: one of the following OlMeetingRecipientType constants: olOptional, olOrganizer, olRequired, or olResource ; TaskItem recipient: one of the following OlTaskRecipientType constants: olFinalStatus, or olUpdate ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _OL_ItemRecipientAdd($oOL, $vItem, $sStoreID, $iType, $vP1, $vP2 = "", $vP3 = "", $vP4 = "", $vP5 = "", $vP6 = "", $vP7 = "", $vP8 = "", $vP9 = "", $vP10 = "", $bAllowUnresolved = True) Local $oRecipient, $aRecipients[10], $oTempRecipient If Not IsNumber($iType) Then Return SetError(5, 0, 0) If Not IsObj($vItem) Then If StringStripWS($vItem, 3) = "" Then Return SetError(1, 0, 0) $vItem = $oOL.Session.GetItemFromID($vItem, $sStoreID) If @error Then Return SetError(2, @error, 0) EndIf ; Move members into an array If Not IsArray($vP1) Then $aRecipients[0] = $vP1 $aRecipients[1] = $vP2 $aRecipients[2] = $vP3 $aRecipients[3] = $vP4 $aRecipients[4] = $vP5 $aRecipients[5] = $vP6 $aRecipients[6] = $vP7 $aRecipients[7] = $vP8 $aRecipients[8] = $vP9 $aRecipients[9] = $vP10 Else $aRecipients = $vP1 EndIf ; add recipients to the item #forceref $oTempRecipient ; to prevent the AU3Check warning: $oTempRecipient: declared, but not used in func. For $iIndex = 0 To UBound($aRecipients) - 1 ; recipient is an object = recipient name already resolved If IsObj($aRecipients[$iIndex]) Then $oTempRecipient = $vItem.Recipients.Add($aRecipients[$iIndex]) If @error Then Return SetError(300 + $iIndex, @error, 0) $oTempRecipient.Type = $iType Else If StringStripWS($aRecipients[$iIndex], 3) = "" Then ContinueLoop $oRecipient = $oOL.Session.CreateRecipient($aRecipients[$iIndex]) If @error Or Not IsObj($oRecipient) Then Return SetError(600 + $iIndex, @error, 0) $oRecipient.Resolve If @error Or Not $oRecipient.Resolved Then If Not (StringInStr($aRecipients[$iIndex], "@")) Or Not ($bAllowUnresolved) Then Return SetError(400 + $iIndex, @error, 0) EndIf $oTempRecipient = $vItem.Recipients.Add($oRecipient) If @error Then Return SetError(300 + $iIndex, @error, 0) $oTempRecipient.Type = $iType EndIf Next $vItem.Save() Return $vItem EndFunc ;==>_OL_ItemRecipientAdd My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki  Link to comment Share on other sites More sharing options...
HighlanderSword Posted April 1, 2015 Share Posted April 1, 2015 (edited) Still have same issue after replacing the Function with the code above, however no error code , the Valid SMTP email address does not get resolved. Edited April 1, 2015 by HighlanderSword Link to comment Share on other sites More sharing options...
water Posted April 2, 2015 Author Share Posted April 2, 2015 Very, very strange! I need to think about it My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki  Link to comment Share on other sites More sharing options...
water Posted April 2, 2015 Author Share Posted April 2, 2015 (edited) Could you please run the following script (change the $sTo in advance)? On the SciTE output pane you should get a "Resolved: True". The displayed mail item should immediately show the recipient as resolved (unterlined). expandcollapse popup#include <OutlookEX.au3> _OL_ErrorNotify(2) $oOL = _OL_Open() Global $sSubject = "CRQ Updates Required" Global $sBody = "<HTML><Body><b>Test</b></body></html>" Global $sTo = "x.y@company.com" ; <== Your recipient goes here ; Create a mail item in the default folder Local $oItem = _OL_ItemCreate($oOL, $olMailItem, "", "", "Subject=" & $sSubject, "BodyFormat=" & $olFormatHTML, "Importance=" & $olImportanceNormal, "HTMLBody=" & $sBody) If @error Then Exit MsgBox(0, "Error ItemCreate", "@error: " & @error + 2000 & ", @extended: " & @extended) ; Add recipients (to) Local $aRecipientsTo If $sTo <> "" Then $aRecipientsTo = StringSplit($sTo, ";", 2) _OL_ItemRecipientAddEx($oOL, $oItem, Default, $olTo, $aRecipientsTo[0]) If @error Then Exit MsgBox(0, "Error RecipientAdd To", "@error: " & @error + 4000 & ", @extended: " & @extended) EndIf ConsoleWrite("Before Send: " & @CRLF) For $oRecipient In $oItem.Recipients ConsoleWrite(" Address: " & $oRecipient.Address & @CRLF) ConsoleWrite(" Class: " & $oRecipient.Class & @CRLF) ConsoleWrite(" Name: " & $oRecipient.Name & @CRLF) ConsoleWrite(" Resolved: " & $oRecipient.Resolved & @CRLF) ConsoleWrite(" Type: " & $oRecipient.Type & @CRLF) ConsoleWrite(@CRLF) Next $oItem.Display() ; Send mail ;_OL_ItemSend($oOL, $oItem, Default) ;If @error Then Exit MsgBox(0, "Error ItemSend", "@error: " & @error + 6000 & ", @extended: " & @extended) _OL_Close($oOL) Func _OL_ItemRecipientAddEx($oOL, $vItem, $sStoreID, $iType, $vP1, $vP2 = "", $vP3 = "", $vP4 = "", $vP5 = "", $vP6 = "", $vP7 = "", $vP8 = "", $vP9 = "", $vP10 = "", $bAllowUnresolved = True) Local $oRecipient, $aRecipients[10], $oTempRecipient If Not IsNumber($iType) Then Return SetError(5, 0, 0) If Not IsObj($vItem) Then If StringStripWS($vItem, 3) = "" Then Return SetError(1, 0, 0) $vItem = $oOL.Session.GetItemFromID($vItem, $sStoreID) If @error Then Return SetError(2, @error, 0) EndIf ; Move members into an array If Not IsArray($vP1) Then $aRecipients[0] = $vP1 $aRecipients[1] = $vP2 $aRecipients[2] = $vP3 $aRecipients[3] = $vP4 $aRecipients[4] = $vP5 $aRecipients[5] = $vP6 $aRecipients[6] = $vP7 $aRecipients[7] = $vP8 $aRecipients[8] = $vP9 $aRecipients[9] = $vP10 Else $aRecipients = $vP1 EndIf ; add recipients to the item #forceref $oTempRecipient ; to prevent the AU3Check warning: $oTempRecipient: declared, but not used in func. For $iIndex = 0 To UBound($aRecipients) - 1 ; recipient is an object = recipient name already resolved If IsObj($aRecipients[$iIndex]) Then $oTempRecipient = $vItem.Recipients.Add($aRecipients[$iIndex]) If @error Then Return SetError(300 + $iIndex, @error, 0) $oTempRecipient.Type = $iType Else If StringStripWS($aRecipients[$iIndex], 3) = "" Then ContinueLoop $oRecipient = $oOL.Session.CreateRecipient($aRecipients[$iIndex]) If @error Or Not IsObj($oRecipient) Then Return SetError(600 + $iIndex, @error, 0) $oRecipient.Resolve() If @error Or Not $oRecipient.Resolved Then If Not (StringInStr($aRecipients[$iIndex], "@")) Or Not ($bAllowUnresolved) Then Return SetError(400 + $iIndex, @error, 0) EndIf $oTempRecipient = $vItem.Recipients.Add($oRecipient) If @error Then Return SetError(300 + $iIndex, @error, 0) $oTempRecipient.Type = $iType $oTempRecipient.Resolve() EndIf Next $vItem.Save() Return $vItem EndFunc ;==>_OL_ItemRecipientAddEx Edited April 2, 2015 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki  Link to comment Share on other sites More sharing options...
HighlanderSword Posted April 2, 2015 Share Posted April 2, 2015 Where is the function _OL_ItemRecipientAddEx located , script fails as it cant find that function Link to comment Share on other sites More sharing options...
water Posted April 2, 2015 Author Share Posted April 2, 2015 Just added it to my post above My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki  Link to comment Share on other sites More sharing options...
HighlanderSword Posted April 2, 2015 Share Posted April 2, 2015 It does not resolve, and the console gives a false Vor Send:  Address:  Class:   4  Name:     *************  Resolved: False  Type:    1 Link to comment Share on other sites More sharing options...
water Posted April 2, 2015 Author Share Posted April 2, 2015 When you run the above script with "x.y@company.com" what do you get? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki  Link to comment Share on other sites More sharing options...
HighlanderSword Posted April 2, 2015 Share Posted April 2, 2015 I get Vor Send:  Address: x.y@company.com  Class:   4  Name:    x.y@company.com  Resolved: True  Type:    1 Link to comment Share on other sites More sharing options...
water Posted April 2, 2015 Author Share Posted April 2, 2015 It seems to be related to the SMTP address you try to use. Is there anything special with this SMTP address? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki  Link to comment Share on other sites More sharing options...
HighlanderSword Posted April 2, 2015 Share Posted April 2, 2015 Nothing special with the SMTP address. Not sure if this will help, but this works in Excel   Sub email()    Dim olkApp As Outlook.Application    Dim maliNewMail As MailItem    Dim strName As String    Dim strNBID As String    Dim strEmail As String    Dim strBody As String    strName = ""    Sheets("Sheet1").Select    [A2].Select    strName = ActiveCell.Value       Do Until strName = "EOL"        strNBID = "xxxxx"        strEmail = "xxxxxx"        Set olkApp = CreateObject("Outlook.Application")        Set maliNewMail = olkApp.CreateItem(olMailItem)            With maliNewMail                .Subject = "Test " & " - " & strNBID                .To = strEmail                .SentOnBehalfOfName = ""                .Body = "TEST " & " - " & strNBID                .Display                '.Send                '.Save 'to send to DRAFT folder            End With        Set maliNewMail = Nothing        Set olkApp = Nothing        ActiveCell.Offset(1, 0).Select        strName = ActiveCell.Value    Loop    Sheets("Parameter").Select    [A1].Select End Sub Link to comment Share on other sites More sharing options...
water Posted April 2, 2015 Author Share Posted April 2, 2015 OK, another try. Does your SMTP address get resolved now? expandcollapse popup#include <OutlookEX.au3> _OL_ErrorNotify(2) $oOL = _OL_Open() Global $sSubject = "CRQ Updates Required" Global $sBody = "<HTML><Body><b>Test</b></body></html>" Global $sTo = "x.y@company.com" ; <== Your recipient goes here ; Create a mail item in the default folder Local $oItem = _OL_ItemCreate($oOL, $olMailItem, "", "", "Subject=" & $sSubject, "BodyFormat=" & $olFormatHTML, "Importance=" & $olImportanceNormal, "HTMLBody=" & $sBody) If @error Then Exit MsgBox(0, "Error ItemCreate", "@error: " & @error + 2000 & ", @extended: " & @extended) ; Add recipients (to) Local $aRecipientsTo If $sTo <> "" Then $aRecipientsTo = StringSplit($sTo, ";", 2) _OL_ItemRecipientAddEx($oOL, $oItem, Default, $olTo, $aRecipientsTo[0]) If @error Then Exit MsgBox(0, "Error RecipientAdd To", "@error: " & @error + 4000 & ", @extended: " & @extended) EndIf ConsoleWrite("Before Send: " & @CRLF) For $oRecipient In $oItem.Recipients $oRecipient.resolve() ConsoleWrite(" Address: " & $oRecipient.Address & @CRLF) ConsoleWrite(" Class: " & $oRecipient.Class & @CRLF) ConsoleWrite(" Name: " & $oRecipient.Name & @CRLF) ConsoleWrite(" Resolved: " & $oRecipient.Resolved & @CRLF) ConsoleWrite(" Type: " & $oRecipient.Type & @CRLF) ConsoleWrite(@CRLF) Next $oItem.Display() ; Send mail ;_OL_ItemSend($oOL, $oItem, Default) ;If @error Then Exit MsgBox(0, "Error ItemSend", "@error: " & @error + 6000 & ", @extended: " & @extended) _OL_Close($oOL) Func _OL_ItemRecipientAddEx($oOL, $vItem, $sStoreID, $iType, $vP1, $vP2 = "", $vP3 = "", $vP4 = "", $vP5 = "", $vP6 = "", $vP7 = "", $vP8 = "", $vP9 = "", $vP10 = "", $bAllowUnresolved = True) Local $oRecipient, $aRecipients[10], $oTempRecipient If Not IsNumber($iType) Then Return SetError(5, 0, 0) If Not IsObj($vItem) Then If StringStripWS($vItem, 3) = "" Then Return SetError(1, 0, 0) $vItem = $oOL.Session.GetItemFromID($vItem, $sStoreID) If @error Then Return SetError(2, @error, 0) EndIf ; Move members into an array If Not IsArray($vP1) Then $aRecipients[0] = $vP1 $aRecipients[1] = $vP2 $aRecipients[2] = $vP3 $aRecipients[3] = $vP4 $aRecipients[4] = $vP5 $aRecipients[5] = $vP6 $aRecipients[6] = $vP7 $aRecipients[7] = $vP8 $aRecipients[8] = $vP9 $aRecipients[9] = $vP10 Else $aRecipients = $vP1 EndIf ; add recipients to the item #forceref $oTempRecipient ; to prevent the AU3Check warning: $oTempRecipient: declared, but not used in func. For $iIndex = 0 To UBound($aRecipients) - 1 ; recipient is an object = recipient name already resolved If IsObj($aRecipients[$iIndex]) Then $oTempRecipient = $vItem.Recipients.Add($aRecipients[$iIndex]) If @error Then Return SetError(300 + $iIndex, @error, 0) $oTempRecipient.Type = $iType Else If StringStripWS($aRecipients[$iIndex], 3) = "" Then ContinueLoop $oRecipient = $oOL.Session.CreateRecipient($aRecipients[$iIndex]) If @error Or Not IsObj($oRecipient) Then Return SetError(600 + $iIndex, @error, 0) $oRecipient.Resolve() If @error Or Not $oRecipient.Resolved Then If Not (StringInStr($aRecipients[$iIndex], "@")) Or Not ($bAllowUnresolved) Then Return SetError(400 + $iIndex, @error, 0) EndIf $oTempRecipient = $vItem.Recipients.Add($oRecipient) If @error Then Return SetError(300 + $iIndex, @error, 0) $oTempRecipient.Type = $iType ; $oTempRecipient.Resolve() EndIf Next $vItem.Save() Return $vItem EndFunc ;==>_OL_ItemRecipientAddEX My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki  Link to comment Share on other sites More sharing options...
HighlanderSword Posted April 2, 2015 Share Posted April 2, 2015 (edited) Nope not resolved, also please note that its not putting in the SMTP email address , its putting in the resolved name (has been doing that always , as compared to Excel it puts in the smtp address) Before Send:  Address:  Class:   4  Name:     **********  Resolved: False  Type:    1 Edited April 2, 2015 by HighlanderSword Link to comment Share on other sites More sharing options...
water Posted April 2, 2015 Author Share Posted April 2, 2015 When you manually enter the SMTP address in the To field of a mail item do you get a dropdown of mail addresses you can select from while you type? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki  Link to comment Share on other sites More sharing options...
HighlanderSword Posted April 2, 2015 Share Posted April 2, 2015 Yes I do Link to comment Share on other sites More sharing options...
Recommended Posts