Sign in to follow this  
Followers 0
shaggy89

Display MessageBox

7 posts in this topic

Hi all,

        I have a script that i need some help with as im new to AutoIT

I have a script that sends a static email but i wish too add a message box to say that the email has been sent.

How would i go about this and where would i add the code ?

correct me if im worng but has it got to do with an exit code ?

Share this post


Link to post
Share on other sites



shaggy89,

Hi, and welcome to AutoIT...

I have a script that i need some help with as im new to AutoIT

 

You will get more help if you post your script.

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

shaggy89,

The link you are pointing to is Jos's excellent mailer.  Get a copy of the script, read through it and use SCiTe to add a messagebox outside of the functions.

Hint: Don't change anything in either of the functions, the code you need to work with is at the top of that link.

Use the Help file for anything that you do not understand...

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

shaggy89,

The link you are pointing to is Jos's excellent mailer.  Get a copy of the script, read through it and use SCiTe to add a messagebox outside of the functions.

Hint: Don't change anything in either of the functions, the code you need to work with is at the top of that link.

Use the Help file for anything that you do not understand...

kylomas

Cheers,

im guessing you pointing me to this spot here

If @error Then
    MsgBox(0, "Error sending message", "Error code:" & @error & "  Description:" & $rc)
EndIf

but is that only if it has an error ?  how do it get to say Email sent ?

I'm also guessing that I would have to add this at the end of it or can it be at the start?

Edited by shaggy89

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

An If..Then can be an If..Then..Else

If 5 > 6 Then
 Consolewrite("5 is greater than 6" & @LF)
Else
 Consolewrite("5 is not greater than 6" & @LF)
EndIf

http://www.autoitscript.com/autoit3/docs/keywords/IfElseEndIf.htm

edit: you should read thru the Help file more.. :graduated:

Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

I don't know Jos's email UDF but I imagine your problem is that you call a function to send an email and then you can't see how to know if the email was sent successfully and so you don't know if you should show a message.

Assuming that is the situation then it is probably quite simple. I would expect that the function you call returns something to tell you what happened. So it would be something like this

 
  $doSendMail = SendMailFunc($param1, $param2....);$doSendMail is set to the returned value of the function
 
 if $doSendMail = $success then
 MsgBox(...
else
 

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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