Sign in to follow this  
Followers 0
Swift

GUICtrlRead($Edit1) I need to convert this to

15 posts in this topic

#1 ·  Posted (edited)

Alright, Well, I have a Edit control, and I need to read this edit, and return it as a array basically, so the edit, can be be the body of the E-mail. It says the body must be a array, so I thought that if somehow I could read the Edit, and convert it or something to a array, then the array would work great for this. If you have another solution please post. Thanks!

#include <GUIConstants.au3>
$ProgramName = IniRead("settings.ini", "Updater", "ProgramName", "")
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate($ProgramName &" Bug Writer", 306, 459, 191, 124, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
$Edit1 = GUICtrlCreateEdit("", 0, 128, 305, 297, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
$Button1 = GUICtrlCreateButton("Send This Bug Report", 0, 432, 305, 25, 0)
$Label1 = GUICtrlCreateLabel("Welcome To The "& $ProgramName & " Bug Writer. Use This Window To Send", 8, 0, 280, 17)
$Label2 = GUICtrlCreateLabel("Your Bug Report To The E-Mail Provided.", 40, 16, 201, 17)
$Input1 = GUICtrlCreateInput("E-Mail", 0, 56, 305, 21)
$Label3 = GUICtrlCreateLabel("Enter The "& $ProgramName & " Developers E-Mail Address Below", 32, 40, 219, 17)
$Label4 = GUICtrlCreateLabel("Type Your Full Bug Report Here. No Less Than 200 Characters", 0, 104, 303, 17)
GUISetState()
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $length = Int(StringLen(GUICtrlRead($Edit1)))
            If Int(StringLen(GUICtrlRead($Edit1))) < 200 Then
                MsgBox(0, "Bug Writer", "Your Bug Report Is Less Than 200 Characters"&@CRLF&"Bug Report Length: "& $length)
            Else
                _EmailIt()
            EndIf
    EndSwitch
WEnd

Func _EmailIt()
    GUICtrlSetState($Edit1, $GUI_DISABLE)
    GUICtrlSetState($Input1, $GUI_DISABLE)
    GUICtrlSetState($Button1, $GUI_DISABLE)
    GUICtrlSetData($Button1, "Sending...")
$s_SmtpServer = "smtp.gmail.com"
$s_FromName = "AutoIt Bug Reporter"
$s_FromAddress = "***********************"
$s_ToAddress = GUICtrlRead($Input1)
$s_Subject = "Bug Report"
Dim $as_Body[2]
$as_Body[0] = "Testing the new email udf"
$as_Body[1] = "Second Line"
$Email = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)
$err = @error
If $Email = 1 Then
    MsgBox(0, "Bug Reporter", "The Email Has Been Sent Successfully!")
    GUICtrlSetState($Edit1, $GUI_ENABLE)
    GUICtrlSetState($Input1, $GUI_ENABLE)
    GUICtrlSetState($Button1, $GUI_ENABLE)
    Exit
Else
    MsgBox(0, "Bug Reporter", "The Email Has Failed To Be Sent!"&@CRLF&"Error: "& $err)
    GUICtrlSetState($Edit1, $GUI_ENABLE)
    GUICtrlSetState($Input1, $GUI_ENABLE)
    GUICtrlSetState($Button1, $GUI_ENABLE)
    GUICtrlSetData($Button1, "Send This Bug Report")
EndIf

EndFunc

Thanks guys!

Edited by Swift

Share this post


Link to post
Share on other sites



You want to convert the text you read from the edit control into an array? What would it be seperated by? Lines?

using the StringSplit() function seems like it would do the trick there...

Share this post


Link to post
Share on other sites

I tried it...its not working...? And I don't know how to check how many arrays a array has in it...so it says dimesion range exceeded, and it doesnt work right ><

Please help me out... :)

#include <GUIConstants.au3>
$ProgramName = "test"
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate($ProgramName &" Bug Writer", 306, 459, 191, 124, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
$Edit1 = GUICtrlCreateEdit("", 0, 128, 305, 297, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
$Button1 = GUICtrlCreateButton("Send This Bug Report", 0, 432, 305, 25, 0)
$Label1 = GUICtrlCreateLabel("Welcome To The "& $ProgramName & " Bug Writer. Use This Window To Send", 8, 0, 280, 17)
$Label2 = GUICtrlCreateLabel("Your Bug Report To The E-Mail Provided.", 40, 16, 201, 17)
$Input1 = GUICtrlCreateInput("E-Mail", 0, 56, 305, 21)
$Label3 = GUICtrlCreateLabel("Enter The "& $ProgramName & " Developers E-Mail Address Below", 32, 40, 219, 17)
$Label4 = GUICtrlCreateLabel("Type Your Full Bug Report Here. No Less Than 200 Characters", 0, 104, 303, 17)
GUISetState()
#EndRegion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $length = Int(StringLen(GUICtrlRead($Edit1)))
            If Int(StringLen(GUICtrlRead($Edit1))) < 200 Then
                MsgBox(0, "Bug Writer", "Your Bug Report Is Less Than 200 Characters"&@CRLF&"Bug Report Length: "& $length)
            Else
                MsgBox(0, "String Is:", GUICtrlRead($Edit1))
                $Body = StringSplit(GUICtrlRead($Edit1), "&@CRLF&")
                MsgBox(0, "", $Body[0] & $Body[1] &@CRLF& $Body[2])
            EndIf
    EndSwitch
WEnd
Func _EmailIt()
    GUICtrlSetState($Edit1, $GUI_DISABLE)
    GUICtrlSetState($Input1, $GUI_DISABLE)
    GUICtrlSetState($Button1, $GUI_DISABLE)
    GUICtrlSetData($Button1, "Sending...")
$s_SmtpServer = "smtp.gmail.com"
$s_FromName = "AutoIt Bug Reporter"
$s_FromAddress = "ProgramBugReporter777@GMail.com"
$s_ToAddress = GUICtrlRead($Input1)
$s_Subject = "Bug Report"
Dim $as_Body[2]
$as_Body[0] = "Testing the new email udf"
$as_Body[1] = "Second Line"
$Email = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)
$err = @error
If $Email = 1 Then
    MsgBox(0, "Bug Reporter", "The Email Has Been Sent Successfully!")
    GUICtrlSetState($Edit1, $GUI_ENABLE)
    GUICtrlSetState($Input1, $GUI_ENABLE)
    GUICtrlSetState($Button1, $GUI_ENABLE)
    Exit
Else
    MsgBox(0, "Bug Reporter", "The Email Has Failed To Be Sent!"&@CRLF&"Error: "& $err)
    GUICtrlSetState($Edit1, $GUI_ENABLE)
    GUICtrlSetState($Input1, $GUI_ENABLE)
    GUICtrlSetState($Button1, $GUI_ENABLE)
    GUICtrlSetData($Button1, "Send This Bug Report")
EndIf

EndFunc

Share this post


Link to post
Share on other sites

I've been waiting for 3 hours now... BUMP! :)

Share this post


Link to post
Share on other sites

I've been waiting for 3 hours now... BUMP! :)

Try waiting 24 hours.. and try to explain better what you're talking about because I can't make heads or tails of it...

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Alright, Well, I have a Edit control, and I need to read this edit, and return it as a array basically, so the edit, can be be the body of the E-mail. It says the body must be a array, so I thought that if somehow I could read the Edit, and convert it or something to a array, then the array would work great for this. If you have another solution please post. Thanks!

Share this post


Link to post
Share on other sites

Alright, Well, I have a Edit control, and I need to read this edit, and return it as a array basically, so the edit, can be be the body of the E-mail. It says the body must be a array, so I thought that if somehow I could read the Edit, and convert it or something to a array, then the array would work great for this. If you have another solution please post. Thanks!

Where does the array start?

Do you have an example of how you want it?

I mean, you've already been given stringsplit, what more do you want?

What does the input going in look like, and the input coming out look like in the array?

I mean come on... I hate it when people ask for help... but can't even take the time to provide an example of what help they actually want, then when people provide answers, they say... "No, that's not what I want"


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Per the help file (_INetSmtpMail):

[optional] The body of the email as a single dimensional array of strings. Each value in the array will be terminated with a @CRLF in the email.

I wonder why the function doesn't just accept a string...curious.

Share this post


Link to post
Share on other sites

I'm still having trouble guys. I can't get this to work right...I even tried writing temperarly to a file, with the edit, and using: _FileReadToArray to read it to a arrary, but I always get error code: 50, the body cannot be sent...

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

The trouble here is posibly not related to the body at all.

I was debuging your script for you and realized that the error code values mentioned in the help file arn't entirely accurate.

the _INetSmtpMail() function is returning error 50, which from the help file indicates line 0 of the body could not be sent. But in fact the function fails before it tries to send the body-

<inet.au3> lines 239-250

If _SmtpSend($v_Socket, $s_Send[0], $s_ReplyCode[0], $b_trace, "220", $s_first) Then
        SetError(50)
        Return 0
    EndIf
    MsgBox(0,"",2)
    ; send header
    For $i_Count = 1 To UBound($s_Send) - 2
        If _SmtpSend($v_Socket, $s_Send[$i_Count], $s_ReplyCode[$i_Count], $b_trace) Then
            SetError(50 + $i_Count)
            Return 0
        EndIf
    Next

You see that a error code of just 50 indicates a problem opening the connection to the server to begin with.

Since this is the case, your problem is probably somewhere in the header, that is the first 4 parameters of _SmtpSend().

I hope you can understand that...

Edited by evilertoaster

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

EDIT: also, what server do I need to use? Another user used this server, but I have no clue what server to use/whats out there...

So, my problem is NOT the body? But something else? I don't know what it could be...I gave a valid email to 'send' from, and I put my email into the input box, and it gave me error: 50, so...I don't know, if anyone could be able to make this work with my GUI it'd be so well apperciated.

Edited by Swift

Share this post


Link to post
Share on other sites

Well, I'll help you out abit more by searching the form for you...

and whatdya know-

http://www.autoitscript.com/forum/index.php?showtopic=63182

http://www.autoitscript.com/forum/index.php?showtopic=63734

http://www.autoitscript.com/forum/index.php?showtopic=64051

summery:

_INetSmtpMail() doesn't work with gmail becuase it needs authentication.

Use the modified version in one of the posts up there.

Share this post


Link to post
Share on other sites

I tried it...heres the errors I get:

#include <GUIConstants.au3>
#Include <File.au3>
$ProgramName = "test"
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate($ProgramName &" Bug Writer", 306, 459, 191, 124, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
Global $Edit1 = GUICtrlCreateEdit("", 0, 128, 305, 297, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
$Button1 = GUICtrlCreateButton("Send This Bug Report", 0, 432, 305, 25, 0)
$Label1 = GUICtrlCreateLabel("Welcome To The "& $ProgramName & " Bug Writer. Use This Window To Send", 8, 0, 280, 17)
$Label2 = GUICtrlCreateLabel("Your Bug Report To The E-Mail Provided.", 40, 16, 201, 17)
Global $Input1 = GUICtrlCreateInput("E-Mail", 0, 56, 305, 21)
$Label3 = GUICtrlCreateLabel("Enter The "& $ProgramName & " Developers E-Mail Address Below", 32, 40, 219, 17)
$Label4 = GUICtrlCreateLabel("Type Your Full Bug Report Here. No Less Than 200 Characters", 0, 104, 303, 17)
GUISetState()
#EndRegion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $length = Int(StringLen(GUICtrlRead($Edit1)))
            If Int(StringLen(GUICtrlRead($Edit1))) < 200 Then
                MsgBox(0, "Bug Writer", "Your Bug Report Is Less Than 200 Characters"&@CRLF&"Bug Report Length: "& $length)
            Else
                _EmailIt()
            EndIf
    EndSwitch
WEnd
Func _EmailIt()
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")
;##################################
; Include
;##################################
;##################################
; Variables
;##################################
$s_SmtpServer = "smtp.gmail.com"             ; address for the smtp-server to use - REQUIRED
$s_FromName = "BugReporter"                  ; name from who the email was sent
$s_FromAddress = "BugReporter110";  address from where the mail should come
$s_ToAddress = GUICtrlRead($Input1)  ; destination address of the email - REQUIRED
$s_Subject = "Bug Report"                 ; subject from the email - can be anything you want it to be
$as_Body = GUICtrlRead($Edit1)                         ; 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 = "BugReporter110@GMail.com"                   ; username for the account used from where the mail gets sent  - Optional (Needed for eg GMail)
$s_Password = "I PUT MY PASSWORD HERE"               ; password for the account used from where the mail gets sent  - Optional (Needed for eg GMail)
$IPPort = 25                             ; port used for sending the mail
$ssl = 0                                 ; enables/disables secure socket layer sending - put to 1 if using httpS
$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
EndFunc

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;==>MyErrFunc

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

First off, here's a cleaner version-

#include <GUIConstants.au3>
#Include <File.au3>
$ProgramName = "test"
Global $oMyRet[2]
Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc")

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate($ProgramName &" Bug Writer", 306, 459, 191, 124, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
Global $Edit1 = GUICtrlCreateEdit("", 0, 128, 305, 297, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN,$WS_VSCROLL))
$Button1 = GUICtrlCreateButton("Send This Bug Report", 0, 432, 305, 25, 0)
$Label1 = GUICtrlCreateLabel("Welcome To The "& $ProgramName & " Bug Writer. Use This Window To Send", 8, 0, 280, 17)
$Label2 = GUICtrlCreateLabel("Your Bug Report To The E-Mail Provided.", 40, 16, 201, 17)
Global $Input1 = GUICtrlCreateInput("E-Mail", 0, 56, 305, 21)
$Label3 = GUICtrlCreateLabel("Enter The "& $ProgramName & " Developers E-Mail Address Below", 32, 40, 219, 17)
$Label4 = GUICtrlCreateLabel("Type Your Full Bug Report Here. No Less Than 200 Characters", 0, 104, 303, 17)
GUISetState()
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $length = Int(StringLen(GUICtrlRead($Edit1)))
            If Int(StringLen(GUICtrlRead($Edit1))) < 200 Then
                MsgBox(0, "Bug Writer", "Your Bug Report Is Less Than 200 Characters"&@CRLF&"Bug Report Length: "& $length)
            Else
                _EmailIt()
            EndIf
    EndSwitch
WEnd
Func _EmailIt()


$s_SmtpServer = "smtp.gmail.com"                ; address for the smtp-server to use - REQUIRED
$s_FromName = "BugReporter"                     ; name from who the email was sent
$s_FromAddress = "BugReporter110@GMail.com"     ;  address from where the mail should come
$s_ToAddress = "BugReporter110@GMail.com"       ; destination address of the email - REQUIRED
$s_Subject = "Bug Report"                       ; subject from the email - can be anything you want it to be
$as_Body = GUICtrlRead($Edit1)                  ; 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 = "BugReporter110@GMail.com"        ; username for the account used from where the mail gets sent  - Optional (Needed for eg GMail)
$s_Password = "I PUT MY PASSWORD HERE"          ; 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

$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

EndFunc

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;==>MyErrFunc

Second- You posted some (unorganzied) code, not an error...

This doesn't work for me obviously becuase i don't have the password...but you need to kidna do some work on your own here...All you've posted is botched up version of already posted code put together with some bubble gum and then wounder wtf is going on... It's a 1/2 step away from basically asking someone to write it for you...

In my opinion it looks like you're in over your head a little... I'd take the time to have a much better understanding of SMTP and AutoIt in general before continuing.

Edited by evilertoaster

Share this post


Link to post
Share on other sites

Thank you so much! You just changed stuff around? Thanks so much! It worked perfectly!!!!!

Yay thanks everyone!!

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  
Followers 0