Email Sender [AutoIt]
Hi guys, Today im gonna share a Tutorial on how to make an Script for Sending a Email with a .exe in AutoIt
Part 1 : Beggining
Part 2 : The Form
Part 3 : The Script
Part 1 : Beggining
1.) You need AutoIt : http://www.autoitscript.com/cgi-bin/...t-v3-setup.exe
2.) After u installed AutoIt go to your Desk and then : Right Click ----> New ----> AutoIt V3 Script
3.) Normally u will see to your desk (If no, Right click to your Desk and the Actualise) Rename if with the name you want like Mail Sender or how you want
4.) Right Click to the Script and Then Select ----> Edit Script And Then Delete all Stuffs writed
Part 2 : The Form
1.) Click to Tools ----> Koda(FormDesigner)
2.) Call the Form with the name you want
3.) Make a Form with 5 Inputs and 1 Button
4.) Call the First Input : My name / The Second Input : My Adress / The Third Input : For the Adress / the 4st Input : Subject / the 5st Input : Message / Call the Button : Send
5.) Press F9 and the Click : Insert to Scite
6.) Normaly you actually script is :
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Your Mailer", 625, 300, 192, 124)
Global $Input1 = GUICtrlCreateInput("My Name", 8, 8, 601, 21)
Global $Input2 = GUICtrlCreateInput("My Adress", 8, 40, 601, 21)
Global $Input3 = GUICtrlCreateInput("For the Adress", 8, 72, 601, 21)
Global $Input4 = GUICtrlCreateInput("Subject", 8, 104, 601, 21)
Global $Input5 = GUICtrlCreateInput("Message", 8, 136, 601, 21)
Global $button1 = GUICtrlCreateButton("Send",8, 200,601,50)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Part 3 : The Script
1.) In the Include Part Add this code :
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#Include <WinAPI.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <file.au3>
#include <INet.au3>
2.) Now Delete the Part with While 1, it should give this (You Will see the Name your choosed on the code and your "Your Mailer" :
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#Include <WinAPI.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <file.au3>
#include <INet.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Your Mailer", 625, 300, 192, 124)
Global $Input1 = GUICtrlCreateInput("Mon Name", 8, 8, 601, 21)
Global $Input2 = GUICtrlCreateInput("My Adress", 8, 40, 601, 21)
Global $Input3 = GUICtrlCreateInput("For the Adresse", 8, 72, 601, 21)
Global $Input4 = GUICtrlCreateInput("Subject", 8, 104, 601, 21)
Global $Input5 = GUICtrlCreateInput("Message", 8, 136, 601, 21)
Global $button1 = GUICtrlCreateButton("Send",8, 200,601,50)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
EndSwitch
WEnd
3.) Now you will need to paste this into While 1 and WEnd (Delete EndSwitch) :
$msg = GUIGetMsg()
If $msg = -3 Then
DirRemove(@TempDir & "\ATP\ATP_Mailer", 1)
GUIDelete($Form1)
ExitLoop
EndIf
If $msg = $Button1 Then
DirCreate(@TempDir & "\ATP\ATP_Mailer")
InetGet("http:/
khan.********/fai.php", @TempDir & "\ATP\ATP_Mailer\smtp")
GUICtrlSetState($Button1, $GUI_DISABLE)
$s_SmtpServer = FileRead(@TempDir & "\ATP\ATP_Mailer\smtp")
$s_FromName=GUICtrlRead($input1)
$s_FromAddress=GUICtrlRead($input2)
$s_ToAddress=GUICtrlRead($input3)
$s_Subject = GUICtrlRead($Input4)
$as_Body[0] = GUICtrlRead($input5)
$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body,"",-1)
sleep(50)
GUICtrlSetState($Button1, $GUI_Enable)
if @error Then
MsgBox(0,"","error "& @error)
Else
MsgBox(0,"","1 mail sended")
EndIf
EndIf
Next
4.) If u do everything i said on the Tutorial Normally your Final Script is :
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#Include <WinAPI.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <file.au3>
#include <INet.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Your Mailer", 625, 300, 192, 124)
Global $Input1 = GUICtrlCreateInput("My Name", 8, 8, 601, 21)
Global $Input2 = GUICtrlCreateInput("My Adresse", 8, 40, 601, 21)
Global $Input3 = GUICtrlCreateInput("For the Adresse", 8, 72, 601, 21)
Global $Input4 = GUICtrlCreateInput("Subject", 8, 104, 601, 21)
Global $Input5 = GUICtrlCreateInput("Message", 8, 136, 601, 21)
Global $button1 = GUICtrlCreateButton("Send",8, 200,601,50)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg = GUIGetMsg()
If $msg = -3 Then
DirRemove(@TempDir & "\ATP\ATP_Mailer", 1)
GUIDelete($Form1)
ExitLoop
EndIf
If $msg = $Button1 Then
DirCreate(@TempDir & "\ATP\ATP_Mailer")
InetGet("http:/
khan.********/fai.php", @TempDir & "\ATP\ATP_Mailer\smtp")
GUICtrlSetState($Button1, $GUI_DISABLE)
$s_SmtpServer = FileRead(@TempDir & "\ATP\ATP_Mailer\smtp")
$s_FromName=GUICtrlRead($input1)
$s_FromAddress=GUICtrlRead($input2)
$s_ToAddress=GUICtrlRead($input3)
$s_Subject = GUICtrlRead($Input4)
$as_Body[0] = GUICtrlRead($input5)
$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body,"",-1)
sleep(50)
GUICtrlSetState($Button1, $GUI_Enable)
if @error Then
MsgBox(0,"","error "& @error)
Else
MsgBox(0,"","1 mail sended")
EndIf
EndIf
Next
EndSwitch
WEnd
5.) Register the Object, Go to your Desk ----> Right Click to your Script ----> Compile Script
Hopefully Guys like it,
Baldrogs
Part 1 : Beggining
Part 2 : The Form
Part 3 : The Script
Part 1 : Beggining
1.) You need AutoIt : http://www.autoitscript.com/cgi-bin/...t-v3-setup.exe
2.) After u installed AutoIt go to your Desk and then : Right Click ----> New ----> AutoIt V3 Script
3.) Normally u will see to your desk (If no, Right click to your Desk and the Actualise) Rename if with the name you want like Mail Sender or how you want
4.) Right Click to the Script and Then Select ----> Edit Script And Then Delete all Stuffs writed
Part 2 : The Form
1.) Click to Tools ----> Koda(FormDesigner)
2.) Call the Form with the name you want
3.) Make a Form with 5 Inputs and 1 Button
4.) Call the First Input : My name / The Second Input : My Adress / The Third Input : For the Adress / the 4st Input : Subject / the 5st Input : Message / Call the Button : Send
5.) Press F9 and the Click : Insert to Scite
6.) Normaly you actually script is :
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Your Mailer", 625, 300, 192, 124)
Global $Input1 = GUICtrlCreateInput("My Name", 8, 8, 601, 21)
Global $Input2 = GUICtrlCreateInput("My Adress", 8, 40, 601, 21)
Global $Input3 = GUICtrlCreateInput("For the Adress", 8, 72, 601, 21)
Global $Input4 = GUICtrlCreateInput("Subject", 8, 104, 601, 21)
Global $Input5 = GUICtrlCreateInput("Message", 8, 136, 601, 21)
Global $button1 = GUICtrlCreateButton("Send",8, 200,601,50)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Part 3 : The Script
1.) In the Include Part Add this code :
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#Include <WinAPI.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <file.au3>
#include <INet.au3>
2.) Now Delete the Part with While 1, it should give this (You Will see the Name your choosed on the code and your "Your Mailer" :
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#Include <WinAPI.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <file.au3>
#include <INet.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Your Mailer", 625, 300, 192, 124)
Global $Input1 = GUICtrlCreateInput("Mon Name", 8, 8, 601, 21)
Global $Input2 = GUICtrlCreateInput("My Adress", 8, 40, 601, 21)
Global $Input3 = GUICtrlCreateInput("For the Adresse", 8, 72, 601, 21)
Global $Input4 = GUICtrlCreateInput("Subject", 8, 104, 601, 21)
Global $Input5 = GUICtrlCreateInput("Message", 8, 136, 601, 21)
Global $button1 = GUICtrlCreateButton("Send",8, 200,601,50)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
EndSwitch
WEnd
3.) Now you will need to paste this into While 1 and WEnd (Delete EndSwitch) :
$msg = GUIGetMsg()
If $msg = -3 Then
DirRemove(@TempDir & "\ATP\ATP_Mailer", 1)
GUIDelete($Form1)
ExitLoop
EndIf
If $msg = $Button1 Then
DirCreate(@TempDir & "\ATP\ATP_Mailer")
InetGet("http:/
khan.********/fai.php", @TempDir & "\ATP\ATP_Mailer\smtp")GUICtrlSetState($Button1, $GUI_DISABLE)
$s_SmtpServer = FileRead(@TempDir & "\ATP\ATP_Mailer\smtp")
$s_FromName=GUICtrlRead($input1)
$s_FromAddress=GUICtrlRead($input2)
$s_ToAddress=GUICtrlRead($input3)
$s_Subject = GUICtrlRead($Input4)
$as_Body[0] = GUICtrlRead($input5)
$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body,"",-1)
sleep(50)
GUICtrlSetState($Button1, $GUI_Enable)
if @error Then
MsgBox(0,"","error "& @error)
Else
MsgBox(0,"","1 mail sended")
EndIf
EndIf
Next
4.) If u do everything i said on the Tutorial Normally your Final Script is :
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GDIPlus.au3>
#Include <WinAPI.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <file.au3>
#include <INet.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1 = GUICreate("Your Mailer", 625, 300, 192, 124)
Global $Input1 = GUICtrlCreateInput("My Name", 8, 8, 601, 21)
Global $Input2 = GUICtrlCreateInput("My Adresse", 8, 40, 601, 21)
Global $Input3 = GUICtrlCreateInput("For the Adresse", 8, 72, 601, 21)
Global $Input4 = GUICtrlCreateInput("Subject", 8, 104, 601, 21)
Global $Input5 = GUICtrlCreateInput("Message", 8, 136, 601, 21)
Global $button1 = GUICtrlCreateButton("Send",8, 200,601,50)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$msg = GUIGetMsg()
If $msg = -3 Then
DirRemove(@TempDir & "\ATP\ATP_Mailer", 1)
GUIDelete($Form1)
ExitLoop
EndIf
If $msg = $Button1 Then
DirCreate(@TempDir & "\ATP\ATP_Mailer")
InetGet("http:/
khan.********/fai.php", @TempDir & "\ATP\ATP_Mailer\smtp")GUICtrlSetState($Button1, $GUI_DISABLE)
$s_SmtpServer = FileRead(@TempDir & "\ATP\ATP_Mailer\smtp")
$s_FromName=GUICtrlRead($input1)
$s_FromAddress=GUICtrlRead($input2)
$s_ToAddress=GUICtrlRead($input3)
$s_Subject = GUICtrlRead($Input4)
$as_Body[0] = GUICtrlRead($input5)
$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body,"",-1)
sleep(50)
GUICtrlSetState($Button1, $GUI_Enable)
if @error Then
MsgBox(0,"","error "& @error)
Else
MsgBox(0,"","1 mail sended")
EndIf
EndIf
Next
EndSwitch
WEnd
5.) Register the Object, Go to your Desk ----> Right Click to your Script ----> Compile Script
Hopefully Guys like it,
Baldrogs


