Jump to content

name of textfile to send with blat


 Share

Recommended Posts

hi folks,

i try to send a file with blat using a smtp server

i have this so far:

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

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 by Zedna
Link to comment
Share on other sites

$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... :whistle:

Henning

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