Are the mail settings as given in preferences still programmatically accessible in V 11.2
Settings are stored at "ApplicationData\SendMail\Preferences\MailSettings.m"
and "ApplicationData\SendMail\Preferences\MailSettingsNew.m"
under the $UserBaseDirectory
.
msp = FileNameJoin[
{
$UserBaseDirectory
, "ApplicationData"
, "SendMail"
, "Preferences"
, "MailSettings.m"
}]
Query["MailSettings", "Server"][Get@msp]
We can access the present settings using an undocumented global variable:
ExternalService`MailSettings`$MailSettings
(*
<| AutoBcc->{},AutoCc->{},EncryptionProtocol->None,FromAddress->None,
FromName->None,Password->Automatic,PortNumber->Automatic,
ReplyTo->Automatic,Server->None,ServerAuthentication->Automatic,
Signature->None,UserName:>$UserName
|>
*)
This variable will reflect changes made by the user through the Preferences dialog.
Thanks to rhermans and WReach my question is not only answered but it also is clear what is going on:
In version 11.2 the variable ExternalService`MailSettings`$MailSettings
will contain the settings as given in the preferences. The source of that information is the file "ApplicationData\SendMail\Preferences\MailSettingsNew.m"
, while older versions used "ApplicationData\SendMail\Preferences\MailSettings.m"
for that purpose.
Looking at the (readprotected) code for ExternalService`MailSettings`$MailSettings
shows that it uses ExternalService`MailSettings`LoadMailSettings
to load those settings. That does use the functions from the package "ResourceLocator`"
to load that file using Get
for the filename returned by ResourceLocator`Private`getPreferenceFile["SendMail", "MailSettingsNew", PreferencesRead]
.
ExternalService`MailSettings`LoadMailSettings
will also take care of converting an old settings file to a new one.