Jump to content

ControlSend, sending email instead of text


Recommended Posts

What I expected.

You started Outlook as a normal user and can't access it when requireadmin is being used.
So without requireadmin you get error = 4400 which means that there is a problem with the recipient. How did you specify the recipient? As a displayname (e.g. "GivenName LastName") or SMTP address (e.g. "GivenName.LastName@company.com")?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

  1. With Display name To is Blank and placed in draft
  2. With Email address To is populated with email address but placed in draft
  3. With requireadmin either way the script continues to run but never populates or errors out, just eventually closes. It does show @error 1 at the start. But now I am not replicating @error 4400 or @error 6002. >.>
     

I dont know how I am no longer getting the error unless the script wasnt finishing ending when I had the requireadmin attached and forced me into those 2 errors? Maybe.... Kind of annoying LOL

EDIT

I mean annoying I missed if that was still running in the background. I got so quick to test and try something new I didnt check my processes to see if it was still going. :/

Edited by tweakster2010
Link to comment
Share on other sites

Could you please run the _OL_Wrapper_SendMail.au3 example script? This should send a mail to your account.
I'm sure this works as it has been tested here ;)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

So here is a catch to my username, i have a pager line as well and that might be part of why its hanging as it sees me 2 times, one time as just my alias the other as my alias - pager. >.> But when I code straight for the e-mail address shoudlnt it just go with its only choice which is the full email address?

EDIT UPDATE

If i change it from $sCurrentUser to my Email@emailaddress i get @error 6002. RequireAdmin just hangs either direction with it. when i do set the e-mail it does add the To field like i mentioned before so I think its struggling with Aliases.

 

EDIT AGAIN

I tagged someone i know who doesnt have a multiple alias on their e-mail (someone without a pager account) and it works fine... So its the way it is recognizing I have my alias for email and my alias for pager account. Would you know a way to reduce it down to just pulling via e-mail and leaving alias out of it when I go to send the e-mail? That seems to be my catch.

Edited by tweakster2010
Link to comment
Share on other sites

I have not found an automated way to do what you want.
We could split _OL_Wrapper_SendMail into the single functions it consists of and if a recipient could not be resolved we could display a selection dialog for you to select the correct recipient.
Would this be possible?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

Ideally i would just reduce out the - pager aspect but another issue i found is this is mostly used for e-mail distribution groups that are in the GAL and I noticed it reports the same error. When I checked what it labeled it never applies the @emailgroup just the Display name which some groups are reduced in naming and can compare to a users first letters of their name. I am playing around with using Com Objects as well right now to do the same but getting a separator message on the Outlookobj.To section I have.

Func EmailSupportR()
Local $OutlookObj = ObjCreate("Outlook.Application")
Local $MailObj = $OutlookObj.CreateItem(0)
With $MailObj
    .To="myemail@email.com"; receiving "missing separator character before keyword.
    .Subject="Subject Testing"
    .Body="This is the body"
    .Display
EndWith

MsgBox(0,"tested","Testing object outlook useage")

EndFunc

This is functional VB code my coworker wrote for  emailing 1 person on a particular issue, so i know functionaly i can get it working on VB but rather focus on keeping it in Autoit as it has been my focus :)

 

EDIT

corrected thekeyboard to keyword (typo ahead of mind)

Edited by tweakster2010
Link to comment
Share on other sites

The error message

"missing separator character before keyword."

is caused by a bug in Au3Check.
Either download the latest beta version of Au3Check (link can be found on the forum when searching for the error message) or disable Au3Check for this script.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

Tomorrow I will take a fresh look at this and start from scratch I jumped all over and lost myself. I started getting a parsing error if requireadmin was removed from teh new script but not on other scripts that dont have requireadmin. So its safe to say i need to stop for the day. Thank you tons! for the help. Lots of info to utilize and determine my next course of action with this issue :)

Link to comment
Share on other sites

ok so i didnt step away instead I went ahead and finish it. Here is my end solution due to the hiccups with how we do things at my place of work vs your awesome tool water! Wish I could of used it for this 1 :(

Here is my current working solution

Func EmailSupportR()
    ;UI
    $EmailSupport = GUICreate("Email Support", 578, 494, 220, 158)
    GUISetBkColor(0x008080)
    ;Check Boxes
    $EG1 = GUICtrlCreateCheckbox("EG1", 8, 8, 145, 17)
    $EG2 = GUICtrlCreateCheckbox("EG2", 8, 24, 105, 17)
    $EG3 = GUICtrlCreateCheckbox("EG3", 8, 40, 97, 17)
    $EG4 = GUICtrlCreateCheckbox("EG4", 8, 56, 97, 17)
    $EG5 = GuiCtrlCreateCheckbox("EG5", 8,72,97,17)
    $EG6 = GuiCtrlCreateCheckbox("EG6",160,72,97,17)
    $EG7 = GUICtrlCreateCheckbox("EG7", 160, 8, 105, 17)
    $EG8 = GUICtrlCreateCheckbox("EG8", 160, 24, 97, 17)
    $EG9 = GUICtrlCreateCheckbox("EG9", 160, 40, 97, 17)
    $EG10 = GUICtrlCreateCheckbox("EG10", 160, 56, 129, 17)
    ;Input fields in UI
    $TitleofEmail = GUICtrlCreateInput("", 8, 90, 553, 21)
    $BodyofEmail = GUICtrlCreateEdit("" , 8, 120, 561, 329, BitOR($ES_WANTRETURN, $WS_VSCROLL))
    ;Buttons in UI
    $EmailSubmit = GUICtrlCreateButton("Submit", 152, 448, 75, 25)
    $emailexit = GUICtrlCreateButton("Exit", 248, 448, 75, 25)
    GuiSetState(@SW_Show)
    While 1
        Sleep(10)
    Switch GuiGetMsg()

        Case $GUI_EVENT_CLOSE
            GuiDelete($EmailSupport)
            Return
        Case $emailexit
            GuiDelete($EmailSupport)
            Return
        Case $EmailSubmit
            Opt("WinTitleMatchMode", 2)
            ;Creates Outlook Object to access
            Local $aArrayGroups[0]
Local $outobj = ObjCreate("Outlook.Application")
;creates email
Local $mailobj = $outobj.CreateItem(0)
;while creating email submits the following information
With $mailobj
            If _IsChecked($EG1) = True Then
                _ArrayAdd($aArrayGroups,"EG1@EG.com;")
            EndIf
            If _IsChecked($EG2) = True Then
                _ArrayAdd($aArrayGroups,"EG2@EG.com;")
            EndIf
            If _IsChecked($EG3) = True Then
                _ArrayAdd($aArrayGroups,"EG3@EG.com;")
            EndIf
            If _IsChecked($EG4) = True Then
                _ArrayAdd($aArrayGroups,"EG4@EG.com;")
            EndIf
            If _IsChecked($EG5) = True Then
                _ArrayAdd($aArrayGroups,"EG5@EG.com;")
            EndIf
            If _IsChecked($EG6) = True Then
                _ArrayAdd($aArrayGroups,"EG6@EG.com;")
            EndIf
            If _IsChecked($EG7) = True Then
                _ArrayAdd($aArrayGroups,"EG7@EG.com;")
            EndIf
            If _IsChecked($EG8) = True Then
                _ArrayAdd($aArrayGroups,"EG8@EG.com;")
            EndIf
            If _IsChecked($EG9) = True Then
                _ArrayAdd($aArrayGroups,"EG9@EG.com;")
            EndIf
            If _IsChecked($EG10) = True Then
                _ArrayAdd($aArrayGroups,"EG10@EG.com;")
            EndIf
        .To = StringReplace(_ArrayToString($aArrayGroups),"|", "")
        .Subject = GuiCtrlRead($TitleofEmail)
        .Body = GuiCtrlRead($BodyofEmail)
        .Display
        .Send
EndWith

    EndSwitch
WEnd

EndFunc

fixed a typo in th example :)

Edited by tweakster2010
Link to comment
Share on other sites

At least you got it working :)
I still need a way to cope with "unresolvable" recipients :sweating:

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...