Jump to content

cant use $get why?


ZoneX
 Share

Recommended Posts

#include <GUIConstants.au3>
; == GUI generated with Koda ==
$Startwindow = GUICreate("send a mail to me!", 625, 463, 186, 113)
GUISetBkColor(0xD4D0C8)
$Logo_figth = GUICtrlCreatePic("C:\Program Files\AutoIt3\Mine scripts\Rs2 Multiauto v.2\medlem_figlogo.jpg", 0, 0, 625, 129)
$text1 = GUICtrlCreateInput("text1", 176, 360, 137, 21, BitOR($ES_UPPERCASE,$ES_LOWERCASE), $WS_EX_CLIENTEDGE)
$text2 = GUICtrlCreateInput("text2", 320, 360, 137, 21, $WS_EX_CLIENTEDGE)
$sumit = GUICtrlCreateButton("sumit", 256, 392, 123, 17)





GUICtrlCreateLabel("Made By ISTE2k", 520, 440, 105, 23)
GUICtrlSetFont(-1, 14, 400, 0, "ChangChang")
$borinfo = GUICtrlCreateGroup("   Bot Info", 8, 144, 161, 305, BitOR($BS_FLAT,$WS_BORDER))
GUICtrlSetFont(-1, 10, 400, 0, "3 theHard way RMX")
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("Benne boten tar:", 16, 184, 112, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Kriminalitet", 16, 208, 85, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Biltyveri\flytting", 16, 256, 119, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Utpressing", 16, 232, 78, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Fight Club", 16, 280, 78, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("25 Pushups", 16, 296, 74, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("Starter kamp: 100kr", 16, 312, 137, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Filmproduksjon", 16, 336, 105, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Club dè Gangster(v.2)", 16, 360, 151, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Fengsels Utbrytninger", 16, 384, 151, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Oppdrag", 16, 408, 64, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group1 = GUICtrlCreateGroup("  Generel", 408, 144, 209, 81, $WS_BORDER)
GUICtrlSetFont(-1, 11, 400, 0, "3 theHard way RMX")
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("mail: ZoneX@hot-joints.biz", 416, 192, 198, 25)
GUICtrlSetFont(-1, 11, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Quit = GUICtrlCreateButton("Exit", 288, 416, 57, 33)
GUICtrlSetFont(-1, 11, 400, 0, "ChangChang")
GUISetState(@SW_SHOW)

Global $oMyRet[2]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
If @error then
    msgbox(0,"Error sending message","Error code:" & @error & "  Description:" & $rc)
EndIf

Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $SENDUSERNAME = "", $SENDPASSWORD = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "")
    $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.Cc = $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
        $SENDPASSWORD = $as_Body & @CRLF
        $SENDPASSWORD = $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") = 25
;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
;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;==>MyErrFunc







While 1
    
    $msg = GUIGetMsg()
    if $msg = $sumit Then
        $SENDtext1  = GUICtrlRead($text1)
        $SENDtext2   = GUICtrlRead($text2, 1 )
        $rc = _INetSmtpMailCom("insertmail", "insert namefrom", "insert mail from", "", "","###(text1,text2)##PROBLEM READ DOWN##", "", "","", "insert mail caopy")
    EndIf
        Select
        Case $msg = $GUI_EVENT_CLOSE
        Case $msg = $Quit
        GUIDelete()
        ExitLoop
    Case Else
;;;;;;;
    EndSelect
Wend
exit

##PROBLEM##

cant get output to work!

want to mail text1 and text2

help me pleas :¤ !! :P

my scecond script *proud* :nuke: hihi :D

sorry for my bad writing.. Norwegian.. :) :rofl:

Edited by ZoneX
Link to comment
Share on other sites

It would be easier to read your code if you enclosed it in [ Code ] [ /Code ] without spaces.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

@ZoneX - Kinda like this. Check out the error codes at the bottom...ViM

#include <GUIConstants.au3>
; == GUI generated with Koda ==
$Startwindow = GUICreate("send a mail to me!", 625, 463, 186, 113)
GUISetBkColor(0xD4D0C8)
$Logo_figth = GUICtrlCreatePic("C:\Program Files\AutoIt3\Mine scripts\Rs2 Multiauto v.2\medlem_figlogo.jpg", 0, 0, 625, 129)
$text1 = GUICtrlCreateInput("text1", 176, 360, 137, 21, BitOR($ES_UPPERCASE,$ES_LOWERCASE), $WS_EX_CLIENTEDGE)
$text2 = GUICtrlCreateInput("text2", 320, 360, 137, 21, $WS_EX_CLIENTEDGE)
$sumit = GUICtrlCreateButton("sumit", 256, 392, 123, 17)

GUICtrlCreateLabel("Made By ISTE2k", 520, 440, 105, 23)
GUICtrlSetFont(-1, 14, 400, 0, "ChangChang")
$borinfo = GUICtrlCreateGroup(" Bot Info", 8, 144, 161, 305, BitOR($BS_FLAT,$WS_BORDER))
GUICtrlSetFont(-1, 10, 400, 0, "3 theHard way RMX")
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("Benne boten tar:", 16, 184, 112, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Kriminalitet", 16, 208, 85, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Biltyveri\flytting", 16, 256, 119, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Utpressing", 16, 232, 78, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Fight Club", 16, 280, 78, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("25 Pushups", 16, 296, 74, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("Starter kamp: 100kr", 16, 312, 137, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Filmproduksjon", 16, 336, 105, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Club dè Gangster(v.2)", 16, 360, 151, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Fengsels Utbrytninger", 16, 384, 151, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Oppdrag", 16, 408, 64, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group1 = GUICtrlCreateGroup(" Generel", 408, 144, 209, 81, $WS_BORDER)
GUICtrlSetFont(-1, 11, 400, 0, "3 theHard way RMX")
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("mail: ZoneX@hot-joints.biz", 416, 192, 198, 25)
GUICtrlSetFont(-1, 11, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Quit = GUICtrlCreateButton("Exit", 288, 416, 57, 33)
GUICtrlSetFont(-1, 11, 400, 0, "ChangChang")
GUISetState(@SW_SHOW)

Global $oMyRet[2]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
If @error then
msgbox(0,"Error sending message","Error code:" & @error & " Description:" & $rc)
EndIf

Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $SENDUSERNAME = "", $SENDPASSWORD = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "")
$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.Cc = $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
$SENDPASSWORD = $as_Body & @CRLF
$SENDPASSWORD = $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") = 25
;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
;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;==>MyErrFunc







While 1

$msg = GUIGetMsg()
if $msg = $sumit Then
$SENDtext1 = GUICtrlRead($text1)
$SENDtext2 = GUICtrlRead($text2, 1 )
$rc = _INetSmtpMailCom("insertmail", "insert namefrom", "insert mail from", "", "","###(text1,text2)##PROBLEM READ DOWN##", "", "","", "insert mail caopy")
EndIf
Select
Case $msg = $GUI_EVENT_CLOSE
Case $msg = $Quit
GUIDelete()
ExitLoop
Case Else
;;;;;;;
EndSelect
Wend
exit

Check this out:

C:\Documents and Settings\Administrator\Desktop\tmp.au3(75,80) : WARNING: $rc: possibly used before declaration.

msgbox(0,"Error sending message","Error code:" & @error & " Description:" & $rc)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Administrator\Desktop\tmp.au3(97,53) : ERROR: _PathFull(): undefined function.

$S_Files2Attach[$x] = _PathFull ($S_Files2Attach[$x])

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

C:\Documents and Settings\Administrator\Desktop\tmp.au3 - 1 error(s), 1 warning(s)

Edited by vim
Link to comment
Share on other sites

HI,

now we'll get no errors anymore.

#include <GUIConstants.au3>
#include <file.au3>
; == GUI generated with Koda ==
$Startwindow = GUICreate("send a mail to me!", 625, 463, 186, 113)
GUISetBkColor(0xD4D0C8)
$Logo_figth = GUICtrlCreatePic("C:\Program Files\AutoIt3\Mine scripts\Rs2 Multiauto v.2\medlem_figlogo.jpg", 0, 0, 625, 129)
$text1 = GUICtrlCreateInput("text1", 176, 360, 137, 21, BitOR($ES_UPPERCASE, $ES_LOWERCASE), $WS_EX_CLIENTEDGE)
$text2 = GUICtrlCreateInput("text2", 320, 360, 137, 21, $WS_EX_CLIENTEDGE)
$sumit = GUICtrlCreateButton("sumit", 256, 392, 123, 17)

GUICtrlCreateLabel("Made By ISTE2k", 520, 440, 105, 23)
GUICtrlSetFont(-1, 14, 400, 0, "ChangChang")
$borinfo = GUICtrlCreateGroup(" Bot Info", 8, 144, 161, 305, BitOR($BS_FLAT, $WS_BORDER))
GUICtrlSetFont(-1, 10, 400, 0, "3 theHard way RMX")
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("Benne boten tar:", 16, 184, 112, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Kriminalitet", 16, 208, 85, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Biltyveri\flytting", 16, 256, 119, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Utpressing", 16, 232, 78, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Fight Club", 16, 280, 78, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("25 Pushups", 16, 296, 74, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("Starter kamp: 100kr", 16, 312, 137, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Filmproduksjon", 16, 336, 105, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Club dè Gangster(v.2)", 16, 360, 151, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Fengsels Utbrytninger", 16, 384, 151, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("-Oppdrag", 16, 408, 64, 23)
GUICtrlSetFont(-1, 10, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group1 = GUICtrlCreateGroup(" Generel", 408, 144, 209, 81, $WS_BORDER)
GUICtrlSetFont(-1, 11, 400, 0, "3 theHard way RMX")
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateLabel("mail: ZoneX@hot-joints.biz", 416, 192, 198, 25)
GUICtrlSetFont(-1, 11, 800, 0, "Comic Sans MS")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetBkColor(-1, 0xD4D0C8)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Quit = GUICtrlCreateButton("Exit", 288, 416, 57, 33)
GUICtrlSetFont(-1, 11, 400, 0, "ChangChang")
GUISetState(@SW_SHOW)

Global $oMyRet[2]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")


Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $SENDUSERNAME = "", $SENDPASSWORD = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Username = "", $s_Password = "")
    $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.Cc = $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
        $SENDPASSWORD = $as_Body & @CRLF
        $SENDPASSWORD = $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") = 25
    ;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
    ;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   ;==>MyErrFunc

While 1
    
    $msg = GUIGetMsg()
    If $msg = $sumit Then
        $SENDtext1 = GUICtrlRead($text1)
        $SENDtext2 = GUICtrlRead($text2, 1)
        $rc = _INetSmtpMailCom("insertmail", "insert namefrom", "insert mail from", "", "", "###(text1,text2)##PROBLEM READ DOWN##", "", "", "", "insert mail caopy")
        If @error Then
            MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc)
        EndIf
    EndIf
    Select
        Case $msg = $GUI_EVENT_CLOSE
        Case $msg = $Quit
            GUIDelete()
            ExitLoop
        Case Else
            ;;;;;;;
    EndSelect
WEnd
Exit

So long,

Mega

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

TANks :P

or Thanks? No problem. Anything left?

So long,

Mega

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

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