Jump to content
Sign in to follow this  
ramirez

Gui to mail

Recommended Posts

ramirez

Hi guys.

 
A little big help in here.
 
I have a GUI with 7 inputs fields and submit button.
I need to, when the operator press the submit the script imports the data to a column table in a mail.oft.
 
At this point I use the SEND command to insert data in the table, line by line.

I want to past all the info in the mail at once.

GUICreate("My Gui", 562, 600, 192, 114)

GUICtrlCreatelabel("Field 1", 200, 80, 324, 20)
$Field1 = GUICtrlCreateInput("Field 1", 200, 100, 324, 20, $ES_NUMBER)
GUICtrlCreatelabel("Field 2", 200, 130, 324, 20)
$Field2 = GUICtrlCreateInput("Field 2", 200, 150, 324, 20, $ES_NUMBER)
GUICtrlCreatelabel("Field 3", 200, 180, 324, 20)
$Field3 = GUICtrlCreateInput("Field 3", 200, 200, 324, 20, $ES_NUMBER)
GUICtrlCreatelabel("Field 4", 200, 230, 324, 20)
$Field4 = GUICtrlCreateInput("Field 4", 200, 250, 324, 20)
GUICtrlCreatelabel("Field 5", 200, 280, 324, 20)
$Field5 = GUICtrlCreateInput("Field 5", 200, 300, 324, 20, $ES_NUMBER)
GUICtrlCreatelabel("Field 6", 200, 330, 324, 20)
$Field6 = GUICtrlCreateInput("Field 6", 200, 350, 324, 20)
GUICtrlCreatelabel("Field 7", 200, 380, 324, 20)
$Field7 = GUICtrlCreateInput("Field 7", 200, 400, 324, 60, $ES_MULTILINE)

$send = GUICtrlCreateButton("send", 200, 480, 324, 40, 0)
$exit = GUICtrlCreateButton("exit", 420, 540, 50, 40, 0)

$lbcentral = GUICtrlCreateLabel("My Gui", 150, 30, 200)
GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif")

$Pic1 = GUICtrlCreatePic("5172_quad.jpg", 20, 150, 141, 142, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
GUISetState()

While 1
        Switch GUIGetMsg()
        Case $SEND
            ShellExecute("send.oft")
            If GUICtrlRead($) = "" Then
               GUICtrlSetData($Field2, "Keep")
            Else
               GUICtrlRead($Field7)
            EndIf
            Sleep(1000)
            Send(GUICtrlRead($Field1) & " - " & GUICtrlRead($Field2))
            Sleep(500)
            Send("{TAB 2}")
            Send(GUICtrlRead($Field1))
            Sleep(500)
            Send("{TAB 2}")
            Send(GUICtrlRead($Field3))
            Sleep(500)
            Send("{TAB 2}")
            Send(GUICtrlRead($Field2))
            Sleep(500)
            Send("{TAB 2}")
            Send(GUICtrlRead($Field4))
            Sleep(500)
            Send("{TAB 2}")
            Send(GUICtrlRead($Field5))
            Sleep(500)
            Send("{TAB 2}")
            Send(GUICtrlRead($Field6))
            Sleep(500)
            Send("{TAB 2}")
            Send(GUICtrlRead($Field7))
            $ask = MsgBox($MB_YESNO, "Send", "Is this correct? This will send the mail.")

            If  $ask = 6 Then
               Send("!s")
            ;Else
            ;Sleep(1500)
            ;Send("!s")
            Endif

            Case $GUI_EVENT_CLOSE
               ExitLoop
            Case $exit
               ExitLoop
         EndSwitch
WEnd
Edited by ramirez
  • Like 1

Share this post


Link to post
Share on other sites
ramirez

Anyone?

  • Like 1

Share this post


Link to post
Share on other sites
water

Looks like you use Outlook to send the mail. You could have a look at my OutlookEX UDF.

  • Like 1

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  

×