|
@@ -17,6 +17,7 @@ func (this *Modules) RegisterAction_SettingsSmtp() *Action {
|
|
|
pf_smtp_port := strings.TrimSpace(wrap.R.FormValue("smtp-port"))
|
|
|
pf_smtp_login := strings.TrimSpace(wrap.R.FormValue("smtp-login"))
|
|
|
pf_smtp_password := strings.TrimSpace(wrap.R.FormValue("smtp-password"))
|
|
|
+ pf_smtp_test_email := strings.TrimSpace(wrap.R.FormValue("smtp-test-email"))
|
|
|
|
|
|
(*wrap.Config).SMTP.Host = pf_smtp_host
|
|
|
(*wrap.Config).SMTP.Port = utils.StrToInt(pf_smtp_port)
|
|
@@ -32,6 +33,18 @@ func (this *Modules) RegisterAction_SettingsSmtp() *Action {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ // Send test message
|
|
|
+ if pf_smtp_test_email != "" {
|
|
|
+ if err := wrap.SendEmail(
|
|
|
+ pf_smtp_test_email,
|
|
|
+ "Fave.Pro SMTP test message",
|
|
|
+ "Hello! This is Fave.Pro test message.<br />If you see this message, then you right configured SMTP settings!",
|
|
|
+ ); err != nil {
|
|
|
+ wrap.MsgError(err.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// Reload current page
|
|
|
wrap.Write(`window.location.reload(false);`)
|
|
|
})
|