Jump to content

cembry90

Active Members
  • Posts

    55
  • Joined

  • Last visited

Everything posted by cembry90

  1. Did this, and ​I actually get the error window as before (the debug code) however the code you provided doesn't show a message box. I would assume this to be indicative of the recipient being added successfully, and thus changed my code to the following. This actually spawns a message box stating that the recipient was added. #include <includes\OutlookEx\OutlookEx.au3> ;#include <debug.au3> ;_DebugSetup() ;_DebugCOMError() ; Open the connection to Outlook Global $oOL = _OL_Open(), $vSSO = "000000000" ; Create a mail item and set some properties Global $oItem = _OL_ItemCreate($oOL, $olMailItem, "*\Drafts", "", "Subject=Test Message", "BodyFormat=" & $olFormatHTML, "HTMLBody=Please disregard.") ; Add a recipient and resolve it $aResult = _OL_ItemRecipientCheck($oOL, $vSSO) If $aResult[1][1] = True Then _OL_ItemRecipientAdd($oOL, $oItem, Default, $olTo, $aResult[1][2]) MsgBox(0, "Success", "Recipient resolved!") Else MsgBox(0, "Error", "Could not resolve recipient!") Exit EndIf ; Send the mail ;_OL_ItemSend($oOL, $oItem) $oItem.Send() ; Close the object _OL_Close($oOL) I got curious about this and added Sleep(5000) between adding a recipient and actually sending the email, thinking maybe that the script was just running "too fast". No such luck. Figured it was worth mentioning that when I run the script once (open Outlook, compose a message, add a recipient, attempt to send it, and fail) and repeat those steps again, the second email sends successfully. It's almost as if the fact that I have an email in the Drafts folder causes it to work. Still no clue as to what is causing this. It's all very strange, and very specific to the case (where users with one letter in the last name fail, but not others). Thanks again for your help.
  2. ​Microsoft Office Professional Plus 2010 - Version: 14.0.7145.5000 (32-bit) Tried to find a way to do this, but it appears it's controlled by an Exchange server and thus you can't give address book contacts an alias.
  3. Sorry about that. Ours are nine-digit numbers, which is why I replaced it with nine 0s. $oSSO = "000000000" $oSSO = "123456789" $oSSO = "112233445" Any of those.
  4. ​It's literally the alias in Outlook. Example:
  5. ; UDF Version ...: 0.9.0 I tried updating (to 1.0.0.0) for good measure, but received the same error.
  6. @error: 0 @extended: 0
  7. ​Yep, sure does! And as I mentioned above - if I remove the call to actually send the email, the email ends up in the Drafts folder with the person's name on the email. I tracked it down to the following: Func _OL_ItemSend($oOL, $vItem, $sStoreID = Default) 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(1, @error, 0) EndIf $vItem.Send() If @error Then MsgBox(0, '', 'ERROR') If @error Then Return SetError(2, @error, 0) Return $vItem EndFunc ;==>_OL_ItemSendIt's specifically failing on $vItem.Send() Confirmed this using the following code: #include <includes\OutlookEx\OutlookEx.au3> #include <debug.au3> _DebugSetup() _DebugCOMError() ; Open the connection to Outlook Global $oOL = _OL_Open() ; Create a mail item and set some properties Global $oItem = _OL_ItemCreate($oOL, $olMailItem, "*\Drafts", "", "Subject=Test Message", "BodyFormat=" & $olFormatHTML, "HTMLBody=Please disregard.") ; Add a recipient and resolve it _OL_ItemRecipientAdd($oOL, $oItem, Default, $olTo, "000000000") ; Send the mail ;_OL_ItemSend($oOL, $oItem) $oItem.Send() ; Close the object _OL_Close($oOL) Thank you.
  8. Thanks again for an awesome UDF, just experiencing one issue while using it. Our company uses SSO to authenticate users, and has each user's SSO listed in the alias field in Outlook. For most of our users, the SSO resolves, your UDF works flawlessly, and the email is sent. However for all of our users who are setup with a single-letter last name (for users in India this is quite common), it fails every single time with the below error. The same does not occur for those who have single-letter first names however. Here's some very rudimentary code (with the actual alias removed) which produces the above error: #include <includes\OutlookEx\OutlookEx.au3> #include <debug.au3> _DebugSetup() _DebugCOMError() Global $oOL = _OL_Open(), $oSSO = "000000000" Global $oItem = _OL_ItemCreate($oOL, $olMailItem, "*\Drafts", "", "Subject=Test Message", "BodyFormat=" & $olFormatHTML, "HTMLBody=Please disregard.") _OL_ItemRecipientAdd($oOL, $oItem, Default, $olTo, $oSSO) _OL_ItemSend($oOL, $oItem) _OL_Close($oOL) I've troubleshot this with a coworker, and it seems to be isolated to the _OL_ItemSend() function (as preparing the message in the Drafts or Outgoing folders does in fact work). What makes it strange is just that - preparing the message translates the name just fine. If I remove the call to _OL_ItemSend() then the message is in the Drafts folder, with the person's name in the "To" field. Any assistance you could provide would be appreciated.
  9. ​Absolutely no idea why, but I just reinstalled Scite and AutoIt again and it seems to be fine now. Maybe something went wrong at install? Either way, thank you.
  10. ​>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\XXXXXXXX\Documents\scripting\AutoIt\bulk email.au3" /UserParams +>15:35:42 Starting AutoIt3Wrapper v.15.503.1200.1 SciTE v.3.5.4.0 Keyboard:00000409 OS:WIN_7/Service Pack 1 CPU:X64 OS:X64 Environment(Language:0409) +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper >Running AU3Check (3.3.10.2) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\XXXXXXXX\Documents\scripting\AutoIt\bulk email.au3 +>15:35:44 AU3Check ended.rc:0 >Running:(3.3.10.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\XXXXXXXX\Documents\scripting\AutoIt\bulk email.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop +>15:35:52 AutoIt3.exe ended.rc:0 +>15:35:52 AutoIt3Wrapper Finished. >Exit code: 0 Time: 10.22 It's worth mentioning that the script runs perfectly as it does on the other machine, with no complications. ​Yes, it's the username I am logged in with on the company machine I use daily. The same username is in both spots below: Full output of "Run AutoIt3/SciTE check" ****************************************************************************************************************************************** * HKCR\.au3 Default :AutoIt3Script * HKCR\.au3 ShellNew :C:\Windows\SHELLNEW\Template.au3 (File Exists) ****************************************************************************************************************************************** * Explorer shell options: * HKCR\AutoIt3Script\shell: * => Default Action:Open * Compile => Command:"C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2Exe_x64.exe" /in "%l" * Compile with Options => Command:"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /ShowGui /in "%l" * CompileX64 => Command:"C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2Exe_x64.exe" /in "%l" * CompileX86 => Command:"C:\Program Files (x86)\AutoIt3\Aut2Exe\Aut2Exe.exe" /in "%l" * Edit => Command:"C:\Program Files (x86)\AutoIt3\SciTE\SciTE.exe" "%1" * Open => Command:"C:\Program Files (x86)\AutoIt3\SciTE\SciTE.exe" "%1" * Run => Command:"C:\Program Files (x86)\AutoIt3\AutoIt3_x64.exe" "%1" %* * RunX64 => Command:"C:\Program Files (x86)\AutoIt3\AutoIt3_x64.exe" "%1" %* * RunX86 => Command:"C:\Program Files (x86)\AutoIt3\AutoIt3.exe" "%1" %* * Tidy => Command:"C:\Program Files (x86)\AutoIt3\SciTE\Tidy\Tidy.exe" "%1" ****************************************************************************************************************************************** * User SciTE info: * Portable:C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig: * Directory missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\Au3Stripper * Directory missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\AutoIt3Wrapper * Directory missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\CodeWizard * Directory missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\SciTE Jump * Directory missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\SciTEConfig * Directory missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\Tidy * File missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\Aabbrev.properties * File missing: C:\Program Files (x86)\AutoIt3\SciTE\SciteConfig\au3abbrev.properties * No SciTEUSer.properties yet ******************************************************************************************************************************************
  11. Fresh AutoIt and Scite install, getting that message when trying to change color scheme (CTRL+1, Editor Colors tab, button at bottom). Never had this before. Found some code in SciTE referencing an environment variable, and assume it's related to the fact that my SCITE_USERHOME environment variable isn't being read properly, despite being set in Windows. The following code does not print the value of the SCITE_USERHOME environment variable: ConsoleWrite(StringFormat("SCITE_USERHOME: %s", EnvGet("SCITE_USERHOME")) & @CRLF) I checked on another computer however, and it is working fine. Any help as to why this is happening would be appreciated.
  12. Yep, but the functionality isn't built-in so that's why I made the wrappper. Thanks for a nice UDF btw.
  13. Function to send mail on behalf of another person or distribution list. ; #FUNCTION# ==================================================================================================================== ; Name...........: _OL_Wrapper_SendMailBehalf ; Description ...: Creatse and sends a mail (wrapper function). ; Syntax.........: _OL_Wrapper_SendMail($oOL[, $sFrom = ""[, $sTo = ""[, $sCc= ""[, $sBCc = ""[, $sSubject = ""[, $sBody = ""[, $sAttachments = ""[, $iBodyFormat = $olFormatUnspecified[, $iImportance = $olImportanceNormal]]]]]]]]]) ; Parameters ....: $oOL - Outlook object returned by a preceding call to _OL_Open() ; $sFrom - Optional: The sender ; $sTo - Optional: The recipient(s), separated by ; ; $sCc - Optional: The CC recipient(s) of the mail, separated by ; ; $sBCc - Optional: The BCC recipient(s) of the mail, separated by ; ; $sSubject - Optional: The Subject of the mail ; $sBody - Optional: The Body of the mail ; $sAttachments - Optional: Attachments, separated by ; ; $iBodyFormat - Optional: The Bodyformat of the mail as defined by the OlBodyFormat enumeration (default = $olFormatUnspecified) ; $iImportance - Optional: The Importance of the mail as defined by the OlImportance enumeration (default = $olImportanceNormal) ; Return values .: Success - Object of the sent mail ; Failure - Returns 0 ; | Sets @error: ; | 1 - $iBodyFormat is not a number ; | 2 - $sBody is missing ; | 4 - $sTo, $sCc and $sBCc are missing ; | 1xxx - Error returned by function _OL_FolderAccess ; | 2xxx - Error returned by function _OL_ItemCreate ; | 3xxx - Error returned by function _OL_ItemModify ; | 4xxx - Error returned by function _OL_ItemRecipientAdd ; | 5xxx - Error returned by function _OL_ItemAttachmentAdd ; | 6xxx - Error returned by function _OL_ItemSend ; | Sets @extended: ; | -2147352567 - No permission to send email on behalf of $sFrom ; Author ........: water ; Modified.......: ; Remarks .......: This is a wrapper function to simplify sending an email. If you have to set more properties etc. you have to do all steps yourself ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _OL_Wrapper_SendMailBehalf($oOL, $sFrom = "", $sTo = "", $sCc = "", $sBCc = "", $sSubject = "", $sBody = "", $sAttachments = "", $iBodyFormat = $olFormatPlain, $iImportance = $olImportanceNormal) If Not IsInt($iBodyFormat) Then SetError(1, 0, 0) If StringStripWS($sBody, 3) = "" Then SetError(2, 0, 0) If StringStripWS($sTo, 3) = "" And StringStripWS($sCc, 3) = "" And StringStripWS($sBCc, 3) = "" Then SetError(3, 0, 0) ; Access the default outbox folder Local $aFolder = _OL_FolderAccess($oOL, "", $olFolderOutbox) If @error Then Return SetError(@error + 1000, @extended, 0) ; Create a mail item in the default folder Local $oItem = _OL_ItemCreate($oOL, $olMailItem, $aFolder[1], "", "Subject=" & $sSubject, "BodyFormat=" & $iBodyFormat, "Importance=" & $iImportance, "SentOnBehalfOfName=" & $sFrom) If @error Then Return SetError(@error + 2000, @extended, 0) ; Set the body according to $iBodyFormat If $iBodyFormat = $olFormatHTML Then _OL_ItemModify($oOL, $oItem, Default, "HTMLBody=" & $sBody) Else _OL_ItemModify($oOL, $oItem, Default, "Body=" & $sBody) EndIf If @error Then Return SetError(@error + 3000, @extended, 0) ; Add recipients (to, cc and bcc) Local $aRecipients If $sTo <> "" Then $aRecipients = StringSplit($sTo, ";", 2) _OL_ItemRecipientAdd($oOL, $oItem, Default, $olTo, $aRecipients) If @error Then Return SetError(@error + 4000, @extended, 0) EndIf If $sCc <> "" Then $aRecipients = StringSplit($sCc, ";", 2) _OL_ItemRecipientAdd($oOL, $oItem, Default, $olCC, $aRecipients) If @error Then Return SetError(@error + 4000, @extended, 0) EndIf If $sBCc <> "" Then $aRecipients = StringSplit($sBCc, ";", 2) _OL_ItemRecipientAdd($oOL, $oItem, Default, $olBCC, $aRecipients) If @error Then Return SetError(@error + 4000, @extended, 0) EndIf ; Add attachments If $sAttachments <> "" Then Local $aAttachments = StringSplit($sAttachments, ";", 2) _OL_ItemAttachmentAdd($oOL, $oItem, Default, $aAttachments) If @error Then Return SetError(@error + 5000, @extended, 0) EndIf ; Send mail _OL_ItemSend($oOL, $oItem, Default) If @error Then Return SetError(@error + 6000, @extended, 0) Return $oItem EndFunc ;==>_OL_Wrapper_SendMailBehalf Edit: Added note showing that @extended=-2147352567 means you don't have permission to send that email.
  14. My auto-updating version of Avast! hasn't had this problem in about a year (maybe more). I would suggest either 1) upgrading, or 2) getting a new anti-virus.
  15. No because 97 killed 99
  16. Nice problem. Here's a short solution (done manually, and with only 100) ;1->2, 3->4, 5->6, 7->8, 9->10, 11->12, 13->14, 15->16, 17->18, 19->20, 21->22, 23->24, 25->26, 27->28, 29->30, 31->32, 33->34, 35->36, 37->38, 39->40, 41->42, 43->44, 45->46, 47->48, 49->50, 51->52, 53->54, 55->56, 57->58, 59->60, 61->62, 63->64, 65->66, 67->68, 69->70, 71->72, 73->74, 75->76, 77->78, 79->80, 81->82, 83->84, 85->86, 87->88, 89->90, 91->92, 93->94, 95->96, 97->98, 99->100 ;1->3, 5->7, 9->11, 13->15, 17->19, 21->23, 25->27, 29->31, 33->35, 37->39, 41->43, 45->47, 49->51, 53->55, 57->59, 61->63, 65->67, 69->71, 73->75, 77->79, 81->83, 85->87, 89->91, 93->95, 97->99 ;1->5, 9->13, 17->21, 25->29, 33->37, 41->45, 49->53, 57->61, 65->69, 73->77, 81->85, 89->93, 97->1 ;9->17, 25->33, 41->49, 57->65, 73->81, 89->97 ;9->25, 41->57, 73->89 ;9->41, 73->9 ;73 wins I'll work on the script to do this later.. Gotta go to class. :-)
  17. Not bad. Done pretty well, to be honest. Also, hello to you (Toady) from a fellow Louisville resident.
  18. I'm not going to help you bot, but I will suggest that you read the help file. What you do on your own time (outside of the forums) is your own business. Don't bring it here though. It's just the way it has to be. Referring to your code, the only help I will offer is that your code is wrong.
  19. Try using this: $in = "password:hello" $out = StringSplit($in, ":") For $i = 1 To $out[0] MsgBox(262144, "", $out[$i], 2) Next
  20. Ahh, I see that you're trying to use more than one letter in a number. Nevermind.
  21. Care to post your code? It would be easier to help you if you did.
  22. Nice tags! Welcome to the realm of AutoIt. Please enjoy your stay.
  23. Define 'raw keys'..? Here's something to get you started. Hopefully it's what you wanted. #include <GUIConstants.au3> ;GUI creation $gui = GUICreate("", 175, 50) $button = GUICtrlCreateButton("", 0, 0, 175, 50) GUISetState() Global $tog, $color[2][2] ;button colors $color[0][0] = 0xff0000;False $color[0][1] = 0x00ff00;True ;text colors $color[1][0] = 0xffffff;False $color[1][1] = 0x000000;True ;Set the GUI elements to False update("False") While 1 $msg = GUIGetMsg($gui) If $msg = $GUI_Event_Close Then Exit ElseIf $msg = $button Then tog() EndIf WEnd ;Toggle the truth of $tog (True <-> False) Func tog() $tog = Not $tog rawKeys($tog) EndFunc ;Update the GUI and do something based on the setting of $raw Func rawKeys($raw) update($raw) setRawKeys($raw) EndFunc ;Update the GUI elements to match the state of $text Func update($text) WinSetTitle($gui, "", $text) GUICtrlSetData($button, $text) GUICtrlSetBkColor($button, $color[0][$text]) GUICtrlSetColor($button, $color[1][$text]) EndFunc ;This can be changed to do whatever you need it to do when enabled or disabled Func setRawKeys($set) If $set Then MsgBox(262144, $set, "Raw keys enabled.", 2) Else ; MsgBox(262144, $set, "Raw keys disabled.", 2) EndIf EndFunc
  24. Here's taking it to another level: ;Tell us what site we want to be checking $site = "http://www.symantec.com/business/security_response/definitions.jsp" ;Get the source of the site (force reload) and ;convert it to human-readable form ;or ;show the error thrown $read = InetRead($site, 1) If Not @error Then $read = BinaryToString($read) Else MsgBox(262144, "Error", "@error : " & @error) EndIf ;Specify how many and which items to look up $items = 6 Local $item[$items], $data $item[0] = "Virus Definitions created" $item[1] = "Virus Definitions released" $item[2] = "Defs Version:" $item[3] = "Sequence Number:" $item[4] = "Extended Version:" $item[5] = "Total Detections (Threats & Risks):" ;Add the items and their values to the $data variable For $i = 0 To $items-1 $data &= $item[$i] & @CRLF & find($read, $item[$i]) & @CRLF Next ;get rid of trailing @CRLF $data = StringTrimRight($data, 2) ;Show us the items and their values MsgBox(262144, "", $data) ;Split the human-readable source by the item ;Split the second portion of the previously split data by a left carat ;Return the information we're supposed to be finding Func find($a, $b) $split = StringSplit($a, $b, 1) $seq = StringSplit($split[2], "<") Return $seq[1] EndFunc
  25. Actually it can be decompiled, but doing so is against the AutoIt terms of use and proof of you decompiling AutoIt scripts could cause you to be banned from this forum. If you want good protection then I suggest you learn a bit of C++ and use Themida. There is almost nothing that you can do that will make your scripts 'safe' enough to, for example, store log-in details to a bank account or whatever. The main problem is that when you compile an AutoIt script, an exact copy of your code is stored and is expanded into memory. Think of it as a 'folder' with your code, and the executable can read this 'folder' and execute the code within when you run the program, thus allowing 'hackers' to get the source from just about every script you make. When I make a new script, I send the executable to my friend and he tries to break into it. If he succeeds, he sends me about 50 lines of code that my script contains (not the includes), to show me that it could be broken into. The only one that he has been unsuccessful in retrieving the source code to is one that I used the C++ DLL and Themida to protect. It's a bit more work, but certain script call for protection that just doesn't exist in AutoIt by default. Themida does not always work well with scripts that the Obfuscator in SciTE cannot obfuscate (namely ones that use the execute() function and objects, such as IE creation), so not all scripts will work correctly when packed using Themida. Good luck!
×
×
  • Create New...