DigDeep Posted September 7, 2015 Share Posted September 7, 2015 (edited) Hi,Can someone please tell me what am I doing wrong here.I am able to run the Blat Install successfully but email part does not work.RunWait(@ComSpec & " /c " & "blat -install smtp.SERVER ADDRESS " & @UserName & "@DOMAIN ADDRESS 3 25 - - - -", "", @SW_HIDE) Local $SMTPADD = "smtp.SERVER ADDRESS" Local $SUBJECT = "Test" Local $TO = "TO ADDRESS" Local $f = "FROM ADDRESS" Local $body = "This is a Test message" Local $log = "log.txt" RunWait("blat.exe -server """ & $SMTPADD & """ -s """ & $SUBJECT & """ -body """ & $body & """ -t """ & $TO & """ -f """ & $f & """ -log """ & $log & """", "", @SW_HIDE) Edited September 7, 2015 by DigDeep Link to comment Share on other sites More sharing options...
Jfish Posted September 7, 2015 Share Posted September 7, 2015 I don't know Blat but I think you need to use single quotes around the entire expression inside the parenthesis instead of double quotes. Use double quotes inside the singles. Also, RunWait might work (do you need the wait part?) but I would also look at ShellExecute. Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
jguinch Posted September 7, 2015 Share Posted September 7, 2015 did you try ShellExecuteWait ?And with the full path of blat.exe ? Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
DigDeep Posted September 7, 2015 Author Share Posted September 7, 2015 well, I even tried with below changes but it still does not sends email.Run(@WindowsDir & "\blat.exe -to " & $TO & " -subject " & $SUBJECT & " -body " & $body & " -server " & $SMTPADD & " -f " & $f) Link to comment Share on other sites More sharing options...
Skysnake Posted September 7, 2015 Share Posted September 7, 2015 Can you write that string to console just before you try to send it?Do something like this:Local $mycommandline = @WindowsDir & "\blat.exe -to " & $TO & " -subject " & $SUBJECT & " -body " & $body & " -server " & $SMTPADD & " -f " & $f ConsoleWrite($mycommandline & @CRLF)Just before the Run() command. I would like to see how AutoIt interprets your varaibles. Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
Jfish Posted September 7, 2015 Share Posted September 7, 2015 (edited) Your variables have no spaces after them ... so the flags would be appended like this:TO ADDRESS-subjectEdit: or maybe the flags have spaces but they are hard to see - I agree with @Skysnake - look at the string first. Also, have you tried with ShellExecute? Edited September 7, 2015 by Jfish Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt Link to comment Share on other sites More sharing options...
jguinch Posted September 7, 2015 Share Posted September 7, 2015 Use @Comspec & " /K blat.exe ..." and remove @SW_HIDE, it will allow you to see the output result. Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
DigDeep Posted September 7, 2015 Author Share Posted September 7, 2015 (edited) Ah! made such a silly mistake... In the FROM ADDRESS, I gave username.Domain.com instead of username@domain.com.I corrected this and it is working now. Thanks all. Edited September 7, 2015 by DigDeep 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