hsoltau Posted July 27, 2006 Share Posted July 27, 2006 hi folks, i try to send a file with blat using a smtp server i have this so far: expandcollapse popup; ---------------------------------------------------------------------------- ; ; AutoIt Version: 3.1.0 ; Author: A.N.Other <myemail@nowhere.com> ; ; Script Function: ; Template AutoIt script. ; ; ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <GUIConstants.au3> #include <process.au3> ; == GUI generated with Koda == $Form1 = GUICreate("AForm1", 331, 293, 192, 125) $Input1 = GUICtrlCreateInput("AInput1", 24, 40, 113, 21) $Input2 = GUICtrlCreateInput("AInput2", 24, 80, 265, 117) $Button1 = GUICtrlCreateButton("AButton1", 96, 224, 49, 33, 0) GUISetState(@SW_SHOW) While 1 $msg = GuiGetMsg() $empf = GUICtrlRead ($Input1) $nachr = GUICtrlRead ($Input2) Select case $msg = $Button1 MsgBox(0,"",$empf) $file = FileOpen(@MDAY&@MON&@YEAR&@HOUR&@min&@SEC &$empf&".txt", 1) FileWrite($file,$nachr) ;FileClose($file) MsgBox(0,"",$file) _RunDOS("start blat.exe " [color=#FF0000]&$file &[/color]"-to mailreceiver -server smtpserver -f mailsuer -u user -pw XXXX") Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;;;;;; EndSelect WEnd Exit the msgbox of $file shows 0, but I need the filename to send... whats wrong with my code, any ideas ? thanx in advance Henning Link to comment Share on other sites More sharing options...
Zedna Posted July 27, 2006 Share Posted July 27, 2006 Try to search in this forum for "blat.exe",there are lots of examples...Here is my post about Run & blat.exe Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
hsoltau Posted July 27, 2006 Author Share Posted July 27, 2006 Try to search in this forum for "blat.exe",there are lots of examples...Here is my post about Run & blat.exethanks Zedna, i read the post...but my newbie question is only, what is the right way to address the file I've createdblat.exe $file doesnt work, because msgbox(0,$file) gives me 0thank you again...Henning Link to comment Share on other sites More sharing options...
Zedna Posted July 27, 2006 Share Posted July 27, 2006 (edited) thanks Zedna, i read the post... but my newbie question is only, what is the right way to address the file I've created blat.exe $file doesnt work, because msgbox(0,$file) gives me 0 thank you again... Henning $file_name = @MDAY&@MON&@YEAR&@HOUR&@min&@SEC &$empf&".txt" $file = FileOpen($file_name, 1) FileWrite($file,$nachr) FileClose($file) _RunDOS("start blat.exe " & $file_name & "-to mailreceiver -server smtpserver -f mailsuer -u user -pw XXXX") EDIT: If your file name contains spaces, use FileGetShortName() or close it to double quotes ... Edited July 27, 2006 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
hsoltau Posted July 27, 2006 Author Share Posted July 27, 2006 $file_name = @MDAY&@MON&@YEAR&@HOUR&@min&@SEC &$empf&".txt" $file = FileOpen($file_name, 1) FileWrite($file,$nachr) FileClose($file) _RunDOS("start blat.exe " & $file_name & "-to mailreceiver -server smtpserver -f mailsuer -u user -pw XXXX") EDIT: If your file name contains spaces, use FileGetShortName() or close it to double quotes ... Hi Zedna, it works with this code _RunDOS("start blat.exe " & $file_name &" -to h thanx again for leading me to the right direction... Henning Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now