Sign in to follow this  
Followers 0
jay

Send Email

10 posts in this topic

#1 ·  Posted (edited)

Does anyone have a script that will easily send a email to an address like hotmail.com from autoIT v3.0? Or a way to easily insert this into a script?

I need really good instruction on how to set it up... I have search the forums for this but did not really see that much information on it.

Thanks for any help

Jay

Edited by jay

Share this post


Link to post
Share on other sites



Does anyone have a script that will easily send a email to an address like hotmail.com from autoIT v3.0? Or a way to easily insert this into a script?

I need really good instruction on how to set it up... I have search the forums for this but did not really see that much information on it.

Thanks for any help

Jay

I suggest you to using blat , a Win32 command line utility that sends eMail using SMTP. I used it a long time before i used autoit, in cmd file...

Share this post


Link to post
Share on other sites

I suggest you to using blat , a Win32 command line utility that sends eMail using SMTP. I used it a long time before i used autoit, in cmd file...

Do you have a example of this

Share this post


Link to post
Share on other sites

Do you have a example of this

blat --help

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Share this post


Link to post
Share on other sites

blat --help
No a Example of getting it to run in AutoIT

Share this post


Link to post
Share on other sites

its usually not that complicated. Form the commands needed to send your email, then just make a few Input boxes for the variables (such as the server, to, from, subject, message) or a GUI if you want it to look nice. Then, just do a run or runwait with the command, and voila.


Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites

its usually not that complicated. Form the commands needed to send your email, then just make a few Input boxes for the variables (such as the server, to, from, subject, message) or a GUI if you want it to look nice. Then, just do a run or runwait with the command, and voila.

Here is my script how do i get blat.exe to read the variables in the script?

; example 1

#include <GUIConstants.au3>

GUICreate("Email GUI App") ; will create a dialog box that when displayed is centered

;INIREAD ---------------------------------------------------

$Ini = "guiemail.ini"

$SMTP = IniRead($Ini, "section1", "SMTP", "Not Found")

$Ini = "guiemail.ini"

$UNAME = IniRead($Ini, "section1", "USERNAME", "Not Found")

$Ini = "guiemail.ini"

$pword = IniRead($Ini, "section1", "PASSWORD", "Not Found")

$Ini = "guiemail.ini"

$TOWHO = IniRead($Ini, "section1", "TO", "Not Found")

$Ini = "guiemail.ini"

$FROMWHO = IniRead($Ini, "section1", "FROM", "Not Found")

$Ini = "guiemail.ini"

$SUBWHO = IniRead($Ini, "section1", "SUBJECT", "Not Found")

$Ini = "guiemail.ini"

$BODYWHO = IniRead($Ini, "section1", "BODY", "Not Found")

;INIREAD ---------------------------------------------------

GUICtrlCreateLabel ("SMTP ADDRESS:", 2, 12, 100, 100, -1, -1)

$SMTPADD = GUICtrlCreateInput($SMTP, 100, 10, 150, 20)

GUICtrlCreateLabel ("USERNAME:", 2, 38, 100, 100, -1, -1) ;+26

$USERNAME = GUICtrlCreateInput ($UNAME, 100, 35, 150, 20) ;+25

GUICtrlCreateLabel ("PASSWORD:", 2, 64, 100, 100, -1, -1)

$PASSWORD = GUICtrlCreateInput ($pword, 100, 60, 150, 20)

GUICtrlCreateLabel ("TO:", 2, 90, 100, 100, -1, -1)

$TO = GUICtrlCreateInput ($TOWHO, 100, 85, 150, 20)

GUICtrlCreateLabel ("FROM:", 2, 116, 100, 100, -1, -1)

$FROM = GUICtrlCreateInput ($FROMWHO, 100, 110, 150, 20)

GUICtrlCreateLabel ("SUBJECT:", 2, 142, 100, 100, -1, -1)

$SUBJECT = GUICtrlCreateInput ($SUBWHO, 100, 135, 150, 20)

GUICtrlCreateLabel ("BODY:", 2, 168, 100, 100, -1, -1)

$BODY = GUICtrlCreateInput ($BODYWHO, 100, 160, 150, 150, $ES_MULTILINE)

$SEND = GUICtrlCreateButton ("SEND", 203, 325, 50, 20)

$SAVE = GUICtrlCreateButton ("SAVE", 152, 325, 50, 20)

$CLOSE = GUICtrlCreateButton ("CLOSE", 100, 325, 50, 20)

GUISetState (@SW_SHOW) ; will display an empty dialog box

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

If $msg = $CLOSE Then ExitLoop

If $msg = $SEND Then

Run(Blat.exe ??????

If $msg = $SAVE Then

;INIWRITE ---------------------------------------------------

IniWrite($Ini, "section1", "SMTP", GUICtrlRead($SMTPADD ))

IniWrite($Ini, "section1", "USERNAME", GUICtrlRead($USERNAME))

IniWrite($Ini, "section1", "PASSWORD", GUICtrlRead($PASSWORD))

IniWrite($Ini, "section1", "TO", GUICtrlRead($TO))

IniWrite($Ini, "section1", "FROM", GUICtrlRead($FROM))

IniWrite($Ini, "section1", "SUBJECT", GUICtrlRead($SUBJECT))

IniWrite($Ini, "section1", "BODY", GUICtrlRead($BODY))

;INIWRITE ---------------------------------------------------

EndIf

Wend

Share this post


Link to post
Share on other sites

As sksbir mentioned, blat is a command line utility, so you will have to read the blat help file and build your command line and pass it to blat accordingly.

Good luck.

Share this post


Link to post
Share on other sites

In other words, Blat will not read the information from the GUI. You have to pass it to blat. You have the concept when you did GUICtrlRead() for the SAVE function. Just get the format for how you pass switches in blat (blat.exe /?), and just insert a GUICtrlRead($Variable) for each field...


Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

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