Sign in to follow this  
Followers 0
SoundOfDeath

E-Mail

7 posts in this topic

#1 ·  Posted (edited)

Hey, I am working on a E-mail option, a friend of my gave me a source and I tryed to update it, here is the script:

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\tjado\Desktop\AutoIt\Form\Sod's Bday Cracker [EMS].kxf
$Form1 = GUICreate("Sod's E-Mail test", 249, 265, 192, 124)
$Group1 = GUICtrlCreateGroup("Info:", 8, 8, 233, 249)
$Label1 = GUICtrlCreateLabel("First Name:", 16, 32, 57, 17)
$Label2 = GUICtrlCreateLabel("E-Mail:", 16, 96, 36, 17)
$Label3 = GUICtrlCreateLabel("Last Name:", 16, 64, 58, 17)
$Input1 = GUICtrlCreateInput("", 104, 32, 121, 21)
$Input2 = GUICtrlCreateInput("", 104, 64, 121, 21)
$Input3 = GUICtrlCreateInput("", 104, 96, 121, 21)
$Label4 = GUICtrlCreateLabel("BirthDay above year:", 16, 128, 103, 17)
$Label5 = GUICtrlCreateLabel("BirthDay bellow year:", 16, 160, 103, 17)
$Combo1 = GUICtrlCreateCombo("Year", 144, 128, 81, 25)
GUICtrlSetData(-1, "2010|2009|2008|2007|2006|2005|2004|2003|2002|2001|2000|1999|1998|1997|1996|1995|1994|1993|1992|1991|1990|1989|1988|1987|1986|1985|1984|1983|1982|1981|1980|1979|1978|1977|1976|1975|1974|1973|1972|1971|1970|1969|1968|1967|1966|1965|1964|1963|1962|1961|1960|1959|1958|1957|1956|1955|1954|1953|1952|1951|1950|1949|1948|1947|1946|1945|1946")
$Combo2 = GUICtrlCreateCombo("Year", 144, 160, 81, 25)
GUICtrlSetData(-1, "2011|2010|2009|2008|2007|2006|2005|2004|2003|2002|2001|2000|1999|1998|1997|1996|1995|1994|1993|1992|1991|1990|1989|1988|1987|1986|1985|1984|1983|1982|1981|1980|1979|1978|1977|1976|1975|1974|1973|1972|1971|1970|1969|1968|1967|1966|1965|1964|1963|1962|1961|1960|1959|1958|1957|1956|1955|1954|1953|1952|1951|1950|1949|1948|1947|1946|1945")
$Button1 = GUICtrlCreateButton("Send", 96, 216, 75, 25, $WS_GROUP)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

    Do
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
            Exit
            Case $Button1
                $email1 = GUICtrlRead($Input1)
                $email2 = GUICtrlRead($Input2)
                $email3 = GUICtrlRead($Input3)
                $emailmsg1 = GUICtrlRead($Input1)
                $emailmsg2 = GUICtrlRead($Input2)
                $emailmsg3 = GUICtrlRead($Input3)
                $emailmsg4 = GUICtrlRead($Combo1)
                $emailmsg5 = GUICtrlRead($Combo2)
                $SmtpServer = "smtp.gmail.com" ; address for the smtp-server to use - REQUIRED
                $FromName = "Name" ; name from who the email was sent
                $FromAddress = $email3
                If $FromAddress = "" Then
                    $FromAddress = "your@Email.Address.com" ; address from where the mail should come
                EndIf

                $ToAddress = "XXXXXXXXXX" ; destination address of the email - REQUIRED
                $Subject = "Info test" ; subject from the email - can be anything you want it to be
                $Body = $emailmsg1 & $emailmsg2 & $emailmsg3 & $emailmsg4 & $emailmsg5 ; the messagebody from the mail - can be left blank but then you get a blank mail
                $AttachFiles = "" ; the file you want to attach- leave blank if not needed
                $CcAddress = "" ; address for cc - leave blank if not needed
                $BccAddress = "" ; address for bcc - leave blank if not needed
                $Importance = "Normal" ; Send message priority: "High", "Normal", "Low"
                $Username = "XXXXXXXXXX" ; username for the account used from where the mail gets sent - REQUIRED
                $Password = "XXXXXXXX" ; password for the account used from where the mail gets sent - REQUIRED
                ;$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

                _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)
                ExitLoop (1)
        EndSwitch
    Until $nMsg = $GUI_EVENT_CLOSE
    GUIDelete($Form1)

The XXXXX are persenal info, so thats not the error, I get a error at the following line:

_INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)

Can someone please help me?

~Thanks

Edited by SoundOfDeath

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

What error message do you get?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Error: Unknown function name.

Share this post


Link to post
Share on other sites

The line

#include <INet.au3>
is missing in your script.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Add this along with the other includes:

#include <INet.au3>

EDIT: Looks like water beat me to it :mellow:

Edited by Kealper

Share this post


Link to post
Share on other sites

Well I added:

#include <INet.au3>

but I still get the same error :S

_INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl)

^ ERROR

Error: Unknown function name.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

That is because it is not part of the standard UDF's supplied with AutoIt3.

Search for it in the Examples forum will do miracles. :mellow:

Edited by Jos
1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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