Jump to content
Sign in to follow this  

Dynamic variables or functions to an executable

Recommended Posts


Hello all, I'm fairly new at AutoIt and sorry if this topic has already been created.

I would like to run an application then if an error presents itself the application calls another mail executable created in autoit that will have dynamic variables or functions that will be specific to the application that had an error. I know this probably is clear as mud right now. I'll try to explain within the email script...

#include <INet.au3>

;****this like will be static*******

$s_SmtpServer = "mail.com"

;****this like will be part of the dynamic section. I would like to have the application name that had the error.*******

$s_FromName = "Testing"

;*****this will be dynamic as something like application@error.com so we know which application sent the error.********

$s_FromAddress = "sender@testing.com"

;****this will be static so no worries here.*****

$s_ToAddress = "receiver@testing.com"

;****I would like this to be dynamic to say which application had an error and if so what it was.*********

$s_Subject = "Can you see this?"

Dim $as_Body[2]

;****I would like this to be similar to the subject where it would say which application had the error and what it was.*****

$as_Body[0] = "Testing the new email"

$as_Body[1] = "Second Line"

$Response = _INetSmtpMail ($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject, $as_Body)

$err = @error

If $Response = 1 Then

MsgBox(0, "Success!", "Mail sent")


MsgBox(0, "Error!", "Mail failed with error code " & $err)


The whole reason for this is to use this email system for multiple scripts we create and we just have to point to this email executable and have the variables or functions setup in the script to use the email executable.

Thank you for any help!

Share this post

Link to post
Share on other sites

Look up in the help file the variable $CmdLine.

You can use it to get data into another executable when you run it.

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