Sign in to follow this  
Followers 0
electrico

MsgBox with variable

17 posts in this topic

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

Share this post


Link to post
Share on other sites



Not enough parameters:

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

WBD

Share this post


Link to post
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")

Share this post


Link to post
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.

Share this post


Link to post
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)

Share this post


Link to post
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?...

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

you succeed? get email message?...

This is the output from the script:

post-49410-1242054478_thumb.png

Share this post


Link to post
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. :)

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

Ye man, you were right. Thanks a lot.

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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.

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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!

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  
Followers 0