Jump to content
Sign in to follow this  
hsoltau

name of textfile to send with blat

Recommended Posts

hsoltau

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

Share this post


Link to post
Share on other sites
hsoltau

Try to search in this forum for "blat.exe",

there are lots of examples...

Here is my post about Run & blat.exe

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

Share this post


Link to post
Share on other sites
Zedna

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

Share this post


Link to post
Share on other sites
hsoltau

$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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.