Jump to content

Mailer


trancexx
 Share

Recommended Posts

This is something I've been working on for the past more than a month. Las few days I finally got time for my self and finished the mailer.

How to work with it?

Just start the script and snoop around the GUI. It's all there, you just have to read text and pictures.

But to make it simple:

  • Start the script (app)
  • Write the title of the message
  • Choose the format of the mail (text or HTML)
  • Write the mail
  • Switch to tab2 ('Account Settings')
  • Click on the light ball (ask if you have some questions)
  • Click on the 'Save Settings'
  • Switch to tab3 ('Sending Options')
  • Fill the form
  • Choose between the servers (you can leave default)
  • Hit 'Send Mail'
  • Monitor (F2 to abort at any time)
  • Do it again

That's it.

It's actually very powerful tool. I won't tell you what's capable of (I'm scared). Don't be an ass and use it for the things you shouldn't be using it for.

You can grab files with your mouse and drop them on GUI. Dropped will be added as attachment(s) to your message if you are on tab1.

Ahh, I forgot to say. Built-in server works asynchronously.

The script (ZIP format because of included images):

Mailer AutoIt.zip

Probably the best mailing tool around!

edit:

New script with added functionalities.

Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Cool.

The ability to automatically resolve the SMTP is pure awesome. GUI is overall cool.

Thoughts:

  • Stops responding when I press "show my ip" (after the IP is shown)
  • What is premium? :)
  • When I try to send I get a 501 error response from the server saying the EHLO request was faulty. Could be my crappy isp though.
  • Maybe add a check for x64 since it doesn't work?
Great job!

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Cool.

The ability to automatically resolve the SMTP is pure awesome. GUI is overall cool.

Thoughts:

  • Stops responding when I press "show my ip" (after the IP is shown)
  • What is premium? :)
  • When I try to send I get a 501 error response from the server saying the EHLO request was faulty. Could be my crappy isp though.
  • Maybe add a check for x64 since it doesn't work?
Great job!

Your ISP is shit. Seriously.

They are blocking you far more than they should. Where are you, in prison? :)

Nothing goes from your comp on port 25. Thts why it's hunging with ip (wraithdu would have that too on some machines, I suppose). 501 shouldn't happen either (I'm not that far off with EHLO).

Will add 64-bit check. It's you know what.

Thanks for the heads-up.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Link to comment
Share on other sites

You can come out now.

I just received a mail from President Barack Obama.

He is saying I did great job and he'll be using this to send mails.

And I said you shouldn't be using it for that :)

His address is the.president@white-house.com if you are interested, and he is from Italy, lol

@monoceres, premium is part of the script not posted here. I forgot to say that.

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Since there is no simple way for me to avoid problems monoceres is experiencing with freaking ISP, here's what I suggest.

monoceres could you run this script and see if it's doing what it should?

#NoTrayIcon

Global $hGUI = GUICreate("Test")

Global $hButton = GUICtrlCreateButton("Check if blocked", 100, 100, 100, 30)
GUICtrlSetOnEvent($hButton, "_Check")

Global $hButtonBlock = GUICtrlCreateButton("Block it!", 100, 200, 100, 30)

_CheckIfIsHungApp($hGUI)

GUISetState()


While 1
    Switch GUIGetMsg()
        Case - 3
            Exit
        Case $hButton
            _Check()
        Case $hButtonBlock
            _Block()
    EndSwitch
WEnd


Func _Check()

    Local $aCall = DllCall("user32.dll", "int", "IsHungAppWindow", "hwnd", $hGUI)
    If @error Then Return
    ConsoleWrite("! Window not responding = " & ($aCall[0] = True) & @CRLF)

EndFunc   ;==>_Check


Func _Block()
    Beep(200, 20000)
EndFunc   ;==>_Block


Func _CheckIfIsHungApp($hWnd)

    Local $aCall = DllCall("kernel32.dll", "ptr", "GetModuleHandleW", "wstr", "user32.dll")

    If @error Or Not $aCall[0] Then
        Return SetError(1, 0, 0)
    EndIf

    Local $hHandle = $aCall[0]

    $aCall = DllCall("kernel32.dll", "ptr", "GetProcAddress", _
            "ptr", $hHandle, _
            "str", "IsHungAppWindow")

    If @error Or Not $aCall[0] Then
        Return SetError(2, 0, 0)
    EndIf

    Local $pIsHungAppWindow = $aCall[0]

    $aCall = DllCall("kernel32.dll", "ptr", "GetProcAddress", _
            "ptr", $hHandle, _
            "str", "MessageBoxW")

    If @error Or Not $aCall[0] Then
        Return SetError(3, 0, 0)
    EndIf

    Local $pMessageBoxW = $aCall[0]


    $aCall = DllCall("kernel32.dll", "ptr", "GetModuleHandleW", "wstr", "kernel32.dll")

    If @error Or Not $aCall[0] Then
        Return SetError(4, 0, 0)
    EndIf

    Local $hHandle = $aCall[0]

    Local $aSleep = DllCall("kernel32.dll", "ptr", "GetProcAddress", _
            "ptr", $hHandle, _
            "str", "Sleep")

    If @error Or Not $aCall[0] Then
        Return SetError(5, 0, 0)
    EndIf

    Local $pSleep = $aSleep[0]

    Local $aExitProcess = DllCall("kernel32.dll", "ptr", "GetProcAddress", _
            "ptr", $hHandle, _
            "str", "ExitProcess")

    If @error Or Not $aCall[0] Then
        Return SetError(6, 0, 0)
    EndIf

    Local $pExitProcess = $aExitProcess[0]

    $aCall = DllCall("kernel32.dll", "ptr", "VirtualAlloc", _
            "ptr", 0, _
            "dword", 512, _
            "dword", 4096, _ ; MEM_COMMIT
            "dword", 4) ; PAGE_READWRITE

    If @error Or Not $aCall[0] Then
        Return SetError(7, 0, 0)
    EndIf

    Local $pStrings = $aCall[0]

    Local $tSpace = DllStructCreate("wchar Title[64];wchar Text[128]", $pStrings)
    DllStructSetData($tSpace, "Title", "Shit")
    DllStructSetData($tSpace, "Text", "The window is hanging." & @CRLF & "Will exit when you click 'OK'." & @CRLF & @CRLF & "Exit code will be '-3'.")

    $aCall = DllCall("kernel32.dll", "ptr", "VirtualAlloc", _
            "ptr", 0, _
            "dword", 512, _
            "dword", 4096, _ ; MEM_COMMIT
            "dword", 64) ; PAGE_EXECUTE_READWRITE

    If @error Or Not $aCall[0] Then
        Return SetError(8, 0, 0)
    EndIf

    Local $pRemoteCode = $aCall[0]

    Local $tCodeBuffer = DllStructCreate("byte[512]", $pRemoteCode)

    DllStructSetData($tCodeBuffer, 1, _
            "0x" & _
            "68" & SwapEndian($hWnd) & _                               ; push window handle
            "B8" & SwapEndian($pIsHungAppWindow) & _                   ; mov eax, [$pIsHungAppWindow]
            "FFD0" & _                                                 ; call eax
            "" & _
            "3D" & SwapEndian(0) & _                                   ; cmp eax, 0
            "75" & Hex(17, 2) & _                                      ; jne 17 bytes
            "" & _
            "68" & SwapEndian(1000) & _                                ; push Milliseconds
            "B8" & SwapEndian($pSleep) & _                             ; mov eax, [$pSleep]
            "FFD0" & _                                                 ; call eax
            "" & _
            "E9" & SwapEndian(-36) & _                                 ; jump back 36 bytes (start address)
            "" & _
            "68" & SwapEndian(262144) & _                              ; push Type (OK + top-most)
            "68" & SwapEndian(DllStructGetPtr($tSpace, "Title")) & _   ; push Title
            "68" & SwapEndian(DllStructGetPtr($tSpace, "Text")) & _    ; push Title
            "68" & SwapEndian(0) & _                                   ; push owner handle
            "B8" & SwapEndian($pMessageBoxW) & _                       ; mov eax, [$pMessageBoxW]
            "FFD0" & _                                                 ; call eax
            "" & _
            "68" & SwapEndian(-3) & _                                  ; push ExitCode
            "B8" & SwapEndian($pExitProcess) & _                       ; mov eax, [$pExitProcess]
            "FFD0" & _                                                 ; call eax
            "" & _
            "C3" _                                                     ; ret
            )

    $aCall = DllCall("kernel32.dll", "ptr", "CreateThread", _
            "ptr", 0, _
            "dword", 0, _
            "ptr", $pRemoteCode, _
            "ptr", 0, _
            "dword", 0, _
            "dword*", 0)

    If @error Or Not $aCall[0] Then
        Return SetError(9, 0, 0)
    EndIf

    Local $hThread = $aCall[0]

    Return $hThread

EndFunc   ;==>_CheckIfIsHungApp


Func SwapEndian($iValue)
    Return Hex(BinaryMid($iValue, 1, 4))
EndFunc   ;==>SwapEndian

Just click 'Block it' and wait. Post your impressions and I'll take it from there.

Another thing is if you could modify the original script at lines 1391 and 1392 from:

_StatusWrite(">>> sending: EHLO MailerClient [" & $sMyIP & "]" & @CRLF)
TCPSend($IConnectionSocket, "EHLO MailerClient [" & $sMyIP & "]" & @CRLF)

to:

_StatusWrite(">>> sending: EHLO [" & $sMyIP & "]" & @CRLF)
TCPSend($IConnectionSocket, "EHLO [" & $sMyIP & "]" & @CRLF)

And if that fails to:

_StatusWrite(">>> sending: EHLO postmaster" & @CRLF)
TCPSend($IConnectionSocket, "EHLO postmaster" & @CRLF)

edit:

I'm thinking this (needs evaluation):

#NoTrayIcon

#AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****

Global Const $hKERNEL32 = DllOpen("kernel32.dll")

Global $hGUI = GUICreate("Test")

Global $hButton = GUICtrlCreateButton("Check if blocked", 100, 100, 100, 30)
GUICtrlSetOnEvent($hButton, "_Check")

Global $hButtonBlock = GUICtrlCreateButton("Block it!", 100, 200, 100, 30)

Global $hCallback = DllCallbackRegister("_OnExitSpecial", "none", "int") ;<- need your opinion on this (check low level code)


_CheckIfIsHungApp($hGUI)

GUISetState()


While 1
    Switch GUIGetMsg()
        Case - 3
            Exit
        Case $hButton
            _Check()
        Case $hButtonBlock
            _Block()
    EndSwitch
WEnd


Func _Check()

    Local $aCall = DllCall("user32.dll", "int", "IsHungAppWindow", "hwnd", $hGUI)
    If @error Then Return
    ConsoleWrite("! Window not responding = " & ($aCall[0] = True) & @CRLF)

EndFunc   ;==>_Check


Func _Block()
    Beep(200, 50000)
EndFunc   ;==>_Block


Func _CheckIfIsHungApp($hWnd)

    Local $aCall = DllCall($hKERNEL32, "ptr", "GetModuleHandleW", "wstr", "user32.dll")

    If @error Or Not $aCall[0] Then
        Return SetError(1, 0, 0)
    EndIf

    Local $hHandle = $aCall[0]

    $aCall = DllCall($hKERNEL32, "ptr", "GetProcAddress", _
            "ptr", $hHandle, _
            "str", "IsHungAppWindow")

    If @error Or Not $aCall[0] Then
        Return SetError(2, 0, 0)
    EndIf

    Local $pIsHungAppWindow = $aCall[0]

    $aCall = DllCall($hKERNEL32, "ptr", "GetProcAddress", _
            "ptr", $hHandle, _
            "str", "MessageBoxW")

    If @error Or Not $aCall[0] Then
        Return SetError(3, 0, 0)
    EndIf

    Local $pMessageBoxW = $aCall[0]

    $aCall = DllCall($hKERNEL32, "ptr", "GetModuleHandleW", "wstr", "kernel32.dll")

    If @error Or Not $aCall[0] Then
        Return SetError(4, 0, 0)
    EndIf

    $hHandle = $aCall[0]

    Local $aSleep = DllCall($hKERNEL32, "ptr", "GetProcAddress", _
            "ptr", $hHandle, _
            "str", "Sleep")

    If @error Or Not $aCall[0] Then
        Return SetError(5, 0, 0)
    EndIf

    Local $pSleep = $aSleep[0]

    Local $aExitProcess = DllCall($hKERNEL32, "ptr", "GetProcAddress", _
            "ptr", $hHandle, _
            "str", "ExitProcess")

    If @error Or Not $aCall[0] Then
        Return SetError(6, 0, 0)
    EndIf

    Local $pExitProcess = $aExitProcess[0]

    $aCall = DllCall($hKERNEL32, "ptr", "VirtualAlloc", _
            "ptr", 0, _
            "dword", 512, _
            "dword", 4096, _ ; MEM_COMMIT
            "dword", 4) ; PAGE_READWRITE

    If @error Or Not $aCall[0] Then
        Return SetError(7, 0, 0)
    EndIf

    Local $pSpace = $aCall[0]

    Local $tStrings = DllStructCreate("wchar Title[64];wchar Text[128]", $pSpace)
    DllStructSetData($tStrings, "Title", "Shit")
    DllStructSetData($tStrings, "Text", "The main window is hanging." & @CRLF & "Will exit when you click 'OK'." & @CRLF & @CRLF & "Exit code will be '-3'.")

    $aCall = DllCall($hKERNEL32, "ptr", "VirtualAlloc", _
            "ptr", 0, _
            "dword", 512, _
            "dword", 4096, _ ; MEM_COMMIT
            "dword", 64) ; PAGE_EXECUTE_READWRITE

    If @error Or Not $aCall[0] Then
        Return SetError(8, 0, 0)
    EndIf

    Local $pRemoteCode = $aCall[0]

    Local $tCodeBuffer = DllStructCreate("byte[512]", $pRemoteCode)

    DllStructSetData($tCodeBuffer, 1, _
            "0x" & _
            "68" & SwapEndian($hWnd) & _                               ; push window handle
            "B8" & SwapEndian($pIsHungAppWindow) & _                   ; mov eax, [$pIsHungAppWindow]
            "FFD0" & _                                                 ; call eax
            "3D" & SwapEndian(0) & _                                   ; cmp eax, 0
            "75" & Hex(17, 2) & _                                      ; jne 17 bytes
            "68" & SwapEndian(1000) & _                                ; push Milliseconds
            "B8" & SwapEndian($pSleep) & _                             ; mov eax, [$pSleep]
            "FFD0" & _                                                 ; call eax
            "E9" & SwapEndian(-36) & _                                 ; jump back 36 bytes (start address)
            "68" & SwapEndian(262144) & _                              ; push Type (OK + top-most)
            "68" & SwapEndian(DllStructGetPtr($tStrings, "Title")) & _ ; push Title
            "68" & SwapEndian(DllStructGetPtr($tStrings, "Text")) & _  ; push Title
            "68" & SwapEndian(0) & _                                   ; push owner handle
            "B8" & SwapEndian($pMessageBoxW) & _                       ; mov eax, [$pMessageBoxW]
            "FFD0" & _                                                 ; call eax
            "68" & SwapEndian(-3) & _                                  ; push ExitCode
            "B8" & SwapEndian(DllCallbackGetPtr($hCallback)) & _       ; mov eax, [$pCallback] ;<- this!
            "FFD0" & _                                                 ; call eax
            "68" & SwapEndian(-3) & _                                  ; push ExitCode
            "B8" & SwapEndian($pExitProcess) & _                       ; mov eax, [$pExitProcess]
            "FFD0" & _                                                 ; call eax
            "C3" _                                                     ; ret
            )

    $aCall = DllCall($hKERNEL32, "ptr", "CreateThread", _
            "ptr", 0, _
            "dword", 0, _
            "ptr", $pRemoteCode, _
            "ptr", 0, _
            "dword", 0, _
            "dword*", 0)

    If @error Or Not $aCall[0] Then
        Return SetError(9, 0, 0)
    EndIf

    Local $hThread = $aCall[0]

    Return $hThread

EndFunc   ;==>_CheckIfIsHungApp


Func SwapEndian($iValue)
    Return Hex(BinaryMid($iValue, 1, 4))
EndFunc   ;==>SwapEndian


Func _OnExitSpecial($iParam)

    ConsoleWrite("! Will exit soon, exit code will be " & $iParam & @CRLF)
    
    MsgBox(262144, 'Aha!', 'Bad things happened.' & @CRLF & "Gonna restart after I document this behavior to registry for the next run (5 sec from now).", 5)

    ; RegWrite(...) ; or whatever
    
    If @Compiled Then
        Run(@ScriptFullPath)
    Else
        ShellExecute(@ScriptFullPath, "", "", "run")
    EndIf

EndFunc   ;==>_OnExitSpecial
Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Tja, inte är den stor iallafall.

Telia is a pretty evil company, most old state companies are.

Not really my music. But hey, the app reminded me off it.

Boom boom pow~

Minesweeper

A minesweeper game created in autoit, source available.

_Mouse_UDF

An UDF for registering functions to mouse events, made in pure autoit.

2D Hitbox Editor

A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes.

Link to comment
Share on other sites

This is something I've been working on for the past more than a month. Las few days I finally got time for my self and finished the mailer.

I'm heating it up the whole day today and surprisingly (yeah right) it's showing to be very stable.

How to work with it?

Just start the script and snoop around the GUI. It's all there, you just have to read text and pictures.

But to make it simple:

  • start the script (app)
  • write the title of the message
  • choose the format of the mail (text or HTML)
  • write the mail
  • switch to tab2 ('Account Settings')
  • click on the light ball (ask if you have some questions)
  • click on the 'Save Settings'
  • switch to tab3 ('Sending Options')
  • fill the form
  • choose between the server (you can leave default)
  • hit 'Send Mail'
  • monitor
  • do it again

That's it.

It's actually very powerful tool. I won't tell you what's capable of (I'm scared). Don't be an ass and use it for the things you shouldn't be using it for.

Btw, probably needs language corrections so if you see something please tell.

There is no chance it's bug free, so do report if you care.

I'm open for questions if there are things to explain.

Ahh, I forgot to say. Even if built-in server works asynchronously, don't block it with modal dialogs because my definition of 'asynchronous' is wide in this case.

The script (ZIP format because of included images):

Probably the best mailing tool around!

Everything that you posted, is that and much more!!! :)

Yes, this is the best mailing tool around!

Five stars (elevated to the cube).

Edited by jscript

http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!)

Somewhere Out ThereJames Ingram

somewh10.png

dropbo10.pngDownload Dropbox - Simplify your life!
Your virtual HD wherever you go, anywhere!

Link to comment
Share on other sites

Everything that you posted, is that and much more!!! :)

Yes, this is the best mailing tool around!

Five stars (elevated to the cube).

E mesmo? :) Imagina!

Glad you like it. I guess that means all works as it should for you. That's great, particulary because of I wasn't able to test 'whois' part of the script like I would want it to.

I have few modifications, will post them eventually.

Um beijo

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

Sorry for the late reply, haven't got time to test it.

The hung windows script worked, the windows freezes for a couple of secs and then I get a messagebox.

As for the changes to 1391-1392 it did change how it worked. Now I get error 550 instead, relaying forbidden.

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Slightly modified script posted, if you are interested.

In case you are blocked by your ISP on port 25, script will restart and mark that behavior so it won't happen again. Nothing will be lost if there is some message in progress (all is backed up).

No cure for relaying refusal.

Ahh, I see by rating that this thread was visited by my mysterious admirer, stalker.

Edited by trancexx

♡♡♡

.

eMyvnE

Link to comment
Share on other sites

  • 1 month later...

Looks nice. Any chance using this behind a proxy?

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

The best GUI I have seen in Autoit in a long time I almost didn't think it was Autoit when it first ran than I was like "oh yea I ran it from the source" really great GUI.

I haven't actually tested it though to early to do so but to be honest just downloaded it for the source and I hope to learn how to make great GUI's.

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...