Bluepoint Design

Practical cost effective solutions   
Macro Express Sample Macro: Email Settings Check

Home
Up
CRLF & TAB Macro
Date String From File Date
Delete to Recycle
Email Settings Check
File Name Increment Macro
eMail Validation
This macro checks the users email settings and updates them as needed. It checks the registry values in ME for email address, user name and SMTP server to make sure they are correct and changes them if not. The user is prompted if this is their name and email address and if not right allows them to correct it.

I use this routine in macros where I use the email system or need the users email address. In general I like to use the registry to keep persistent settings for that workstation and usually define some in the miscellaneous key but in this case we need to adjust the ME email keys so ME can send email properly. In this case you will need to modify the macro for your SMTP server. Just replace the string IP1 with your server's address.

Beyond checking to make sure the setting are correct for the email send command I often use these registry values for data entry. For instance I have macros that enter meta data in Acrobat files which include the creator's name. I get this value from this registry value. And obviously anywhere you need the user's email address you can read this registry value to string.

The sample file is a playable macro which you can simply download and launch.

Page last updated: 02/05/2008
 

Email_Settings_Check.mxe
Macro Script
Variable Save All Variables
// T1 check email address and update if need be
Read Registry String: "EMail Name"
If Variable %T1% = ""
Variable Set String %T1% from Prompt
Write Registry String: "EMail Name"
Reload Macro Express Preferences
Else
If Message: "User Name"
Else
Variable Set String %T1% from Prompt
Write Registry String: "EMail Name"
Reload Macro Express Preferences
End If
End If
// T2 check email address and update if need be
Read Registry String: "EMail Address"
If Variable %T2% = ""
Variable Set String %T2% from Prompt
Write Registry String: "EMail Address"
Reload Macro Express Preferences
Else
If Message: "Email address"
Else
Variable Set String %T2% from Prompt
Write Registry String: "EMail Address"
Reload Macro Express Preferences
End If
End If
// T3 check SMTP server
Read Registry String: "SMTP Host"
If Variable %T3% = "IP1"
Else
Variable Set String %T3% "IP1"
Write Registry String: "SMTP Host"
Reload Macro Express Preferences
End If
Variable Restore All Variables
Macro Text
<VARSR:01><REM2:T1 check email address and update if need be><REGRSTR:1:HKEY_LOCAL_MACHINE\SOFTWARE\Insight Software Solutions\Macro Express\EMail\EMail Name><IFVAR2:1:01:1:><TVAR2:01:02:FWhat's your full name?FFCenter:Center><REGWSTR:1:HKEY_LOCAL_MACHINE\SOFTWARE\Insight Software Solutions\Macro Express\EMail\EMail Name><RELOADPREFS><ELSE><IFMESS3:00000:1:1:User NameAre you %T1%?Center:Center><ELSE><TVAR2:01:02:FWhat's your full name?FFCenter:Center><REGWSTR:1:HKEY_LOCAL_MACHINE\SOFTWARE\Insight Software Solutions\Macro Express\EMail\EMail Name><RELOADPREFS><ENDIF><ENDIF><REM2:T2 check email address and update if need be><REGRSTR:2:HKEY_LOCAL_MACHINE\SOFTWARE\Insight Software Solutions\Macro Express\EMail\EMail Address><IFVAR2:1:02:1:><TVAR2:02:02:FWhat's your email address?FFCenter:Center><REGWSTR:2:HKEY_LOCAL_MACHINE\SOFTWARE\Insight Software Solutions\Macro Express\EMail\EMail Address><RELOADPREFS><ELSE><IFMESS3:00000:1:1:Email addressIs your email address %T2%?Center:Center><ELSE><TVAR2:02:02:FWhat's your email address?FFCenter:Center><REGWSTR:2:HKEY_LOCAL_MACHINE\SOFTWARE\Insight Software Solutions\Macro Express\EMail\EMail Address><RELOADPREFS><ENDIF><ENDIF><REM2:T3 check SMTP server><REGRSTR:3:HKEY_LOCAL_MACHINE\SOFTWARE\Insight Software Solutions\Macro Express\EMail\SMTP Host><IFVAR2:1:03:1:IP1><ELSE><TVAR2:03:01:IP1><REGWSTR:3:HKEY_LOCAL_MACHINE\SOFTWARE\Insight Software Solutions\Macro Express\EMail\SMTP Host><RELOADPREFS><ENDIF><VARSR:05>
 
Practical cost effective solutions