Hallo zusammen,
ich habe ein dringendes Problem.
wenn ich über das Outlook UDF eine Mail versenden will (im Auftrag von ) und in der Liste ein User ist der nicht im Outlookadressbuch ist gibt es einen Fehler wenn die Person an erster
Stelle steht oder wenn er an 2. Stelle steht werden keine Mails an alle die dahinter stehen geschickt.
Das ist fatal! gibt es eine Möglichkeit diese User Automatisch zu Filtern oder nicht zu beachten ?
Hier einmal die Senden Funktion:
[autoit]
Func Senden()
Global $iMax
Global $iMax1
Global $iMax2
Local $data = $pto
Local $data1 = $pcc
Local $data2 = _GUICtrlEdit_GetText($fbcc)
Global $to = StringSplit($data, ";",2)
Global $cc = StringSplit($data1, ";",2)
Global $bcc = StringSplit($data2, ";",2)
If IsArray($to) Then
$iMax = UBound($to); get array size
For $i = 0 to $iMax - 1; subtract 1 from size to prevent an out of bounds error
Next
EndIf
If IsArray($cc) Then
$iMax1 = UBound($cc); get array size
For $i = 0 to $iMax1 - 1; subtract 1 from size to prevent an out of bounds error
Next
EndIf
If IsArray($bcc) Then
$iMax2 = UBound($bcc); get array size
For $i = 0 to $iMax - 1; subtract 1 from size to prevent an out of bounds error
Next
EndIf
#ConsoleWrite($to[0] & @CRLF)
#ConsoleWrite($to[1] & @CRLF)
; Open the connection to Outlook
Global $oOL = _OL_Open()
; Create a mail item and set some properties
Global $oItem = _OL_ItemCreate($oOL, $olMailItem, "*", "", "Subject=" & $betreff, "BodyFormat=" & $olFormatHTML, "HTMLBody=" & $textfeld, "SentOnBehalfOfName=Servicedesk")
ConsoleWrite("itemcreate error " & @error & " Extendet " & @extended & @CRLF)
; Add a recipient and resolve it
_OL_ItemRecipientAdd($oOL, $oItem, Default, $olTo, $to)
_OL_ItemRecipientAdd($oOL, $oItem, Default, $olcc, $cc)
_OL_ItemRecipientAdd($oOL, $oItem, Default, $olbcc, $bcc)
ConsoleWrite("itemrecive error " & @error & " Extendet " & @extended & @CRLF)
; Send the mail
_OL_ItemSend($oOL, $oItem)
If @extended = -2147352567 Then _
MsgBox(16, "OutlookEX UDF - Example Script", "You don't have permission to send the mail on behalf of the specified person!")
ConsoleWrite("send error " & @error & " Extendet " & @extended & @CRLF)
EndFunc
[/autoit]ich hoffe ihr könnt mir helfen.
Gruß
Florian