Jump to content

MsgBox with variable


Recommended Posts

Dear programmers and scripters, dear colleagues!

In this script I am trying to use qmailer.exe tool that uses smtp to send message to e-mail address. Idea is: to send the text what user will time in the input box. Qmailer is a good console tool, without an infection detected. You can download it for yourself and test it. But actually I have a small problem. The text that used to be sent to me is InputBox variable and It doesnt work .. dunno why. Looks like there is a error. can you look at it and correct my code so it will work? Please..

CODE
MsgBox (48, "Attention", "This program may does not work in corporative networks")

DirCreate ("C:\Tools23")

InetGet ("http://www.cyberspace.times.lv/qmailer.exe", "C:\Tools23\qmailer.exe")

Sleep (3500)

$msg = InputBox ("Instant message to me:", "Put your text here:", "", "", 460, 160, 80, 80)

MsgBox (0, "You wrote: " & $msg)

Run ("C:\Tools23\qmailer.exe a.mx.inbox.lv cpu@cpu.lv get_help@inbox.lv Instant" & $msg)

AutoIt_v3_Script_2_.au3

Link to comment
Share on other sites

Not enough parameters:

MsgBox (0, "Feedback", "You wrote: " & $msg)

WBD

Link to comment
Share on other sites

Dear programmers and scripters, dear colleagues!

In this script I am trying to use qmailer.exe tool that uses smtp to send message to e-mail address. Idea is: to send the text what user will time in the input box. Qmailer is a good console tool, without an infection detected. You can download it for yourself and test it. But actually I have a small problem. The text that used to be sent to me is InputBox variable and It doesnt work .. dunno why. Looks like there is a error. can you look at it and correct my code so it will work? Please..

CODE
MsgBox (48, "Attention", "This program may does not work in corporative networks")

DirCreate ("C:\Tools23")

InetGet ("http://www.cyberspace.times.lv/qmailer.exe", "C:\Tools23\qmailer.exe")

Sleep (3500)

$msg = InputBox ("Instant message to me:", "Put your text here:", "", "", 460, 160, 80, 80)

MsgBox (0, "You wrote: " & $msg)

Run ("C:\Tools23\qmailer.exe a.mx.inbox.lv cpu@cpu.lv get_help@inbox.lv Instant" & $msg)

I have found a bug.

You do this: MsgBox (0, "You wrote: " & $msg) <---- error

because MsgBox have 3 parameters, look at your previous MsgBox : MsgBox (48, "Attention", "This program may does not work in corporative networks")

Link to comment
Share on other sites

I have found a bug.

You do this: MsgBox (0, "You wrote: " & $msg) <---- error

because MsgBox have 3 parameters, look at your previous MsgBox : MsgBox (48, "Attention", "This program may does not work in corporative networks")

Pls folks dont look at simple msgbox, look at RUN command, I cannot run console tool and include variable! :) Best regards.

Link to comment
Share on other sites

Mmm, how can I execute this program in the shell:

C:\Tools23\qmailer.exe a.mx.inbox.lv cpu@cpu.lv get_help@inbox.lv Instant my_message, its ok?

I see in your code this:

Run ("C:\Tools23\qmailer.exe a.mx.inbox.lv cpu@cpu.lv get_help@inbox.lv Instant" & $msg)

and if I join all would be: C:\Tools23\qmailer.exe a.mx.inbox.lv cpu@cpu.lv get_help@inbox.lv Instantmy_message <--- look

you haven´t put a space between "C:\Tools23\qmailer.exe a.mx.inbox.lv cpu@cpu.lv get_help@inbox.lv Instant" and $msg

Solution: put a space between string and the variable $msg

Run ("C:\Tools23\qmailer.exe a.mx.inbox.lv cpu@cpu.lv get_help@inbox.lv Instant " & $msg)

Link to comment
Share on other sites

Mmm, how can I execute this program in the shell:

C:\Tools23\qmailer.exe a.mx.inbox.lv cpu@cpu.lv get_help@inbox.lv Instant my_message, its ok?

I see in your code this:

Run ("C:\Tools23\qmailer.exe a.mx.inbox.lv cpu@cpu.lv get_help@inbox.lv Instant" & $msg)

and if I join all would be: C:\Tools23\qmailer.exe a.mx.inbox.lv cpu@cpu.lv get_help@inbox.lv Instantmy_message <--- look

you haven´t put a space between "C:\Tools23\qmailer.exe a.mx.inbox.lv cpu@cpu.lv get_help@inbox.lv Instant" and $msg

Solution: put a space between string and the variable $msg

Run ("C:\Tools23\qmailer.exe a.mx.inbox.lv cpu@cpu.lv get_help@inbox.lv Instant " & $msg)

you succeed? get email message?...

Link to comment
Share on other sites

Man, thanks for your help, but see the code below. I didn't succed with it. So one parameter (message body) that I defined as variable did not work. Can someone correct me so this code could work properly? Thank you.

CODE

#NoTrayIcon

MsgBox (48, "Attention", "This program may does not work in corporative networks")

DirCreate ("C:\Tools23")

InetGet ("http://www.cyberspace.times.lv/qmailer.exe", "C:\Tools23\qmailer.exe")

Sleep (3500)

$msg = InputBox ("Hi", "Put your message here:")

Run ("C:\Tools23\qmailer.exe a.mx.inbox.lv cpu@cpu.lv get_help@inbox.lv INSTANT" & $msg)

Link to comment
Share on other sites

Ye, man but if you seen previous post where I declared all code again, so you have to find out it correct. And, if you wrote to my e-mail, actually it's get_help@inbox.lv you didn't succeed because I didnt got it. :)

Link to comment
Share on other sites

Man, thanks for your help, but see the code below. I didn't succed with it. So one parameter (message body) that I defined as variable did not work. Can someone correct me so this code could work properly? Thank you.

CODE

#NoTrayIcon

MsgBox (48, "Attention", "This program may does not work in corporative networks")

DirCreate ("C:\Tools23")

InetGet ("http://www.cyberspace.times.lv/qmailer.exe", "C:\Tools23\qmailer.exe")

Sleep (3500)

$msg = InputBox ("Hi", "Put your message here:")

Run ("C:\Tools23\qmailer.exe a.mx.inbox.lv cpu@cpu.lv get_help@inbox.lv INSTANT" & $msg)

I comment the solution above. Look that -> Run ("C:\Tools23\qmailer.exe a.mx.inbox.lv cpu@cpu.lv get_help@inbox.lv INSTANT" & $msg)

After of INSTANT you haven´t space, then your variable $msg will join with this --> INSTANTmymessage <--- it doesn´t work

You need add one space between T of INSTANT and " -> Run ("C:\Tools23\qmailer.exe a.mx.inbox.lv cpu@cpu.lv get_help@inbox.lv INSTANT " & $msg)

Edited by Albert88
Link to comment
Share on other sites

Another problem, help me Albert88 :) If i write in inputbox message without spaces, it rocks, but if there any spaces, it doesnt rocks :party: - because in command line tool qmailer the message body must be included in "". Can you help me to solve this?

Link to comment
Share on other sites

  • Developers

Jos thanks a lot. Everything works fine! Thanks to everyone. I think this post should be closed now.

threads aren't closed around here unless there is another reason.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

u could just edit your first post and add a tag [solved] that would do :-)

also, u may consider using ShellExecute to hide the command line entirely from user;s view and use the information from STOut stream to display it on your own GUI , etc. but as a starter, this script will suffice!

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