@@ -193,13 +193,27 @@ Module modMail
193193 Return "Mail module disabled"
194194 End Function
195195
196+ Function DisableChecks() As String
197+ Unload()
198+ modDatabase.AddOrUpdateConfig( "Mail_ScheduledChecks" , "disabled" )
199+ Load()
200+ Return "Scheduled mail checks disabled"
201+ End Function
202+
196203 Function Enable() As String
197204 My.Settings.Mail_Enable = True
198205 My.Application.Log.WriteEntry( "Mail module is enabled" )
199206 Load()
200207 Return "Mail module enabled"
201208 End Function
202209
210+ Function EnableChecks() As String
211+ Unload()
212+ modDatabase.AddOrUpdateConfig( "Mail_ScheduledChecks" , "enabled" )
213+ Load()
214+ Return "Scheduled mail checks enabled"
215+ End Function
216+
203217 ''' <summary>
204218 ''' This function returns the CmdKey of a CmdAllowlist email.
205219 ''' </summary>
@@ -358,6 +372,13 @@ Module modMail
358372
359373 CreateMailkeysDb()
360374
375+ If My.Settings.Mail_SMTPHost = "smtp.purelymail.com" AndAlso modDatabase.GetConfig( "Mail_PurelyMailAPIKey" ) = "" Then
376+ My.Application.Log.WriteEntry( "SMTP is PurelyMail, but no API key set, asking for it" )
377+ Dim strNewPurelyMailAPIKey As String = InputBox( "Enter an API key for your PurelyMail account to monitor remaining funds" , "PurelyMail API Key" )
378+ If strNewPurelyMailAPIKey = "" Then strNewPurelyMailAPIKey = "(skipped)"
379+ modDatabase.AddOrUpdateConfig( "Mail_PurelyMailAPIKey" , strNewPurelyMailAPIKey)
380+ End If
381+
361382 oClient.Host = My.Settings.Mail_SMTPHost
362383 oClient.Port = My.Settings.Mail_SMTPPort
363384 If oClient.Port = 465 OrElse oClient.Port = 587 Then
0 commit comments