Jump to content
Sign in to follow this  

email with program to run like mstsc

Recommended Posts


I have a script that will check my home external IP and send me an email at my work with the information in the body mail.  It already work but I would like to push it a little more with the line $as_Body[2] in hyperlink.  I will be able to click on the hyperlink to connect home.  Here's my script

  #include <Inet.au3>
  #include <MsgBoxConstants.au3>

  Local $sPublicIP = _GetIP()
  Local $s_SmtpServer = "smtp.server.here"
  Local $s_FromName = "ME"
  Local $s_FromAddress = "a@b.com"
  Local $s_ToAddress = "c@d.com"
  Local $s_Subject = "My WAN IP - version 1"

  Local $as_Body[3]
  $as_Body[0] = "Actualy, my home IP is:"
  $as_Body[1] = $sPublicIP
  $as_Body[2] = "mstsc /v:" & $sPublicIP

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

Thanks for any help  :thumbsup:

Share this post

Link to post
Share on other sites

hello Propoganda, welcome to AutoIt and to the forum!

to create a hyperlink to a file, prefix the file with the string file://


1. you need to specify the full path to the file

2. this is not AutoIt-specific

3. this was not tested over email (especially MIME), but i believe it would work

b.t.w to post code in the forum, use the code tags (the A button in the toolbar).

EDIT: it should be file:/// (3 slashes) and also slashes instead of backslashes in the full path, like this:


EDIT #2: it works if you open the email in Outlook (or, i guess, any email application which supports it), but not in webmail interface (tested with Yahoo).

Edited by orbs

Share this post

Link to post
Share on other sites

Hi orbs,

Thanks for the reply.  It works to open Remote Desktop Program with warnings.  The only thing I have to check is to feed the RDP window with the variable $sPublicIP automatically.

If you have another idea or someone else.


I appreciated  TKS

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...