Jump to content

Wont send Email...


Recommended Posts

Hey i have posted this but know one helped me and it got lost ^_^ anyways. The code below does not send an Email and i cant see were i have made the mistake could someone help me out? Also uploaded the ini i am using with smtp servers listed its a ini but had to rename it to upload. Thanks :)

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.8.1
 Author:         Possessed

 Script Function:
Emailing spoofer

#ce ----------------------------------------------------------------------------
#include <GUIConstants.au3>
#include <INet.au3>

GUISetOnEvent($GUI_EVENT_CLOSE, "Special")
GUICreate("Email Spoofer  v1.0.0",256,480)
GUISetState (@SW_SHOW)
GUISetBkColor (0x000000)
GUICtrlCreatePic("logo-Emailspoofer.jpg",0,0,256,64)
;---------------Lablels--------
GUICtrlCreateLabel ("From:",145,60,100)
GUICtrlSetColor(-1,0x00FF33); LimeGreen
GUICtrlCreateLabel ("To:", 10,60,100)
GUICtrlSetColor(-1,0x00FF33); LimeGreen
GUICtrlCreateLabel ("Subject:",10,105,100)
GUICtrlSetColor(-1,0x00FF33); LimeGreen
GUICtrlCreateLabel ("Message:",10,150,100)
GUICtrlSetColor(-1,0x00FF33); LimeGreen
GUICtrlCreateLabel ("SMTP Servers:",10,375,90)
GUICtrlSetColor(-1,0x00FF33); LimeGreen
;---------My ini stuff---------

$T_STR = ""
$ARRAY = IniReadSection("SMTP servers.ini", "SMTP")
If @error Then
    MsgBox(4096, "Error occured", ", Error reading : " & @ScriptDir & "\SMTP servers.ini file.")
    Exit
Else
    For $I = 1 To $ARRAY[0][0]
        If (StringLen($T_STR) == 0) Then
            $T_STR = $ARRAY[$I][1]
        Else
            $T_STR = $T_STR & "|" & $ARRAY[$I][1]
        EndIf
    Next
EndIf

;---------Button's-------------
$Button1 = GUICtrlCreateButton("Send", 9, 440, 240, 30, 0)
           GUICtrlSetFont(-1, 12, 400, 0, "Lucida Console")
           GUICtrlSetCursor ($Button1, 0)
           GUICtrlSetOnEvent(-1, "Emailspoof")   
    
;--------GUI Input-------
$To =   GUICtrlCreateInput  ("", 10,  75, 100, 20)
        GUICtrlSetTip(-1,"Put victim's Email here.")
$From = GUICtrlCreateInput ( "", 145,  75, 100, 20)
        GUICtrlSetTip(-1,"Put Spoof Email here.")
$Subject = GUICtrlCreateInput  ("", 10, 120, 100, 20)
        GUICtrlSetTip(-1,"Subject of Email goes here.")
        
$msg = GUICtrlCreateEdit ("", 10,165,235,200,$ES_AUTOVSCROLL+$WS_VSCROLL)

$SMTPList = GUICtrlCreateCombo ("", 10, 390,200,$CBS_DROPDOWNLIST )
GUICtrlSetData(-1, $T_STR, $ARRAY[1][1]); add other items



;Handling the GUI
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE;Exit form GUI
            Exitloop
        Case $msg = $Button1
            Emailspoof()
        Case Else
       ; Something else
    EndSelect
Wend

Exit

;---------Func's---------------
func Special()
   
EndFunc


Func Emailspoof()
$s_SmtpServer = GUICtrlRead($SMTPList)
$s_FromName = GUICtrlRead($From)
$s_FromAddress = GUICtrlRead($From)
$s_ToAddress = GUICtrlRead($To)
$s_Subject = GUICtrlRead($Subject)
$as_Body = GUICtrlRead($msg)

$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)
    EndFunc
Link to comment
Share on other sites

If you are trying to use an SSL smtp server(gmail, yahoo, etc), this wont work.

Try using this:

http://www.autoitscript.com/forum/index.ph...st&p=166575

#Include<file.au3>
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
;##################################
; Include
;##################################
#Include<file.au3>
;##################################
; Variables
;##################################
$s_SmtpServer = "smtp.gmail.com"          ; address for the smtp-server to use - REQUIRED
$s_FromName = ""                          ; name from who the email was sent
$s_FromAddress = "................."      ; address from where the mail should come
$s_ToAddress = "........................"      ; destination address of the email - REQUIRED
$s_Subject = ".............."                   ; subject from the email - can be anything you want it to be
$as_Body = ".............."                     ; the messagebody from the mail - can be left blank but then you get a blank mail
$s_AttachFiles = ""                       ; the file you want to attach- leave blank if not needed
$s_CcAddress = ""                         ; address for cc - leave blank if not needed
$s_BccAddress = ""                        ; address for bcc - leave blank if not needed
$s_Username = "........................"                 ; username for the account used from where the mail gets sent  - Optional (Needed for eg GMail)
$s_Password = "password"          ; password for the account used from where the mail gets sent  - Optional (Needed for eg GMail)
$IPPort=465                               ; GMAIL port used for sending the mail
$ssl=1                                    ; GMAILenables/disables secure socket layer sending - put to 1 if using httpS

;##################################
; Script
;##################################
Global $oMyRet[2]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
$rc = _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body, $s_AttachFiles, $s_CcAddress, $s_BccAddress, $s_Username, $s_Password, $IPPort, $ssl)
If @error Then
    MsgBox(0, "Error sending message", "Error code:" & @error & "  Rc:" & $rc)
EndIf
;

Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "",$IPPort=25, $ssl=0)
    $objEmail = ObjCreate("CDO.Message")
    $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>'
    $objEmail.To = $s_ToAddress
    Local $i_Error = 0
    Local $i_Error_desciption = ""
    If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress
    If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress
    $objEmail.Subject = $s_Subject
    If StringInStr($as_Body,"<") and StringInStr($as_Body,">") Then
        $objEmail.HTMLBody = $as_Body 
    Else
        $objEmail.Textbody = $as_Body & @CRLF
    EndIf
    If $s_AttachFiles <> "" Then
        Local $S_Files2Attach = StringSplit($s_AttachFiles, ";")
        For $x = 1 To $S_Files2Attach[0]
            $S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])
            If FileExists($S_Files2Attach[$x]) Then
                $objEmail.AddAttachment ($S_Files2Attach[$x])
            Else
                $i_Error_desciption = $i_Error_desciption & @lf & 'File not found to attach: ' & $S_Files2Attach[$x]
                SetError(1)
                return 0
            EndIf
        Next
    EndIf
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer
    $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort
;Authenticated SMTP
    If $s_Username <> "" Then
        $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
        $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username
        $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password
    EndIf
    If $Ssl Then 
        $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
    EndIf
;Update settings
    $objEmail.Configuration.Fields.Update
; Sent the Message
    $objEmail.Send
    if @error then 
        SetError(2)
        return $oMyRet[1]
    EndIf
EndFunc ;==>_INetSmtpMailCom
;
;
; Com Error Handler
Func MyErrFunc()
    $HexNumber = Hex($oMyError.number, 8)
    $oMyRet[0] = $HexNumber
    $oMyRet[1] = StringStripWS($oMyError.description,3)
    ConsoleWrite("### COM Error !  Number: " & $HexNumber & "   ScriptLine: " & $oMyError.scriptline & "   Description:" & $oMyRet[1] & @LF) 
    SetError(1); something to check for when this function returns
    Return
EndFunc ;==>MyErrFunoÝ÷ Úí+ºÚ"µÍ[ÈQ[XZ[    ÌÍÙWÔÙ[    ÌÍÙWÔXÚY[  ÌÍÙWÐØÐYÜË  ÌÍÙWÔÝXXÝ ÌÍÙWÕ^
BNÈ[ÈÜÈ[Ý[ÛHPHËÝÝÝË]]Ú]ØÜÛÛKÙÜ[[^ÜÏI[ÜÚÝÝÜXÏLÎ
    [ÝY]ÏY[ÜÝ   [ÜLMMÍBIÌÍÛÓ^QÜHØ][
    ][ÝÐ]]Ò]Ü][ÝË ][ÝÓ^Q[É][ÝÊBIÌÍÛØYÜØYÙHHØÜX]J    ][ÝÐÑËYÜØYÙI][ÝÊBUÚ]  ÌÍÛØYÜØYÙBBKÝXXÝH  ÌÍÙWÔÝXXÝBKÙ[H   ÌÍÙWÔÙ[BKÛHH  ÌÍÙWÔÙ[BKÈH   ÌÍÙWÔXÚY[BKØÈH   ÌÍÙWÐØÐYÜÂBK^ÙHH   ÌÍÙWÕ^Q[Ú]] ÌÍÛØYÜØYÙKÛÛYÝ][ÛY[ÂBK][J   ][ÝÚËÜØÚ[XËZXÜÜÛÙÛÛKØÙËØÛÛYÝ][ÛÜÙ[Ú[É][ÝÊHHBK][J ][ÝÚËÜØÚ[XËZXÜÜÛÙÛÛKØÙËØÛÛYÝ][ÛÜÛ]Ù][ÝÊHH ÌÍÜÛ]ÙBK][J    ][ÝÚËÜØÚ[XËZXÜÜÛÙÛÛKØÙËØÛÛYÝ][ÛÜÛ]]][]I][ÝÊHHBBK][J ][ÝÚËÜØÚ[XËZXÜÜÛÙÛÛKØÙËØÛÛYÝ][ÛÜÙ[Ù[YI][ÝÊHH  ÌÍÜÙ[Ù[YBBK][J ][ÝÚËÜØÚ[XËZXÜÜÛÙÛÛKØÙËØÛÛYÝ][ÛÜÙ[ÜÝÛÜ   ][ÝÊHH    ÌÍÜÙ[ÜÝÛÜBK][][ÝÚËÜØÚ[XËZXÜÜÛÙÛÛKØÙËØÛÛYÝ][ÛÜÛ]ÙÜ   ][ÝÊHH

HÌBBK][J   ][ÝÚËÜØÚ[XËZXÜÜÛÙÛÛKØÙËØÛÛYÝ][ÛÜÛ]ÛÛXÝ[Û[Y[Ý]   ][ÝÊHH
BK][J   ][ÝÚËÜØÚ[XËZXÜÜÛÙÛÛKØÙËØÛÛYÝ][ÛÜÛ]ÙÜÛ ][ÝÊHHYBBK]BQ[Ú]IÌÍÛØYÜØYÙKÙ[RYÜ[^Q[Ê
BIÌÍÛÓ^QÜH ][ÝÉ][ÝÂIÌÍÛØYÜØYÙHH ][ÝÉ][ÝÂ[[ÈÏOIÝÛQ[XZ[[È^Q[Ê
BSÙÐÞ
K   ][ÝÐÓÓHÈ[[Ü][ÝË ][ÝÕÈÙÜ[HÈY[[YHH][ÓÓHÜ ][ÝÊBQ^][[ÈÏOIÝÓ^Q[
Edited by Oldschool
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...