Skip to content

Commit 881fdf6

Browse files
committed
add smtp test
2 parents b66fe09 + bf399e6 commit 881fdf6

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

src/app/settings/settings.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ <h2 i18n="@@five_second_shield">5-second Shield</h2>
208208
<mat-label i18n="@@smtp_password">Password</mat-label>
209209
<input matInput [(ngModel)]="settings.smtp.smtp_password" type="password" [readonly]="readOnlyValue" required/>
210210
</mat-form-field>
211+
<section>
212+
<button mat-button mat-stroked-button i18n="@@test_smtp" (click)="testSMTP()">Test SMTP</button>
213+
</section>
211214
</div>
212215
</mat-tab>
213216

src/app/settings/settings.component.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,11 @@ export class SettingsComponent implements OnInit {
118118
}
119119
}
120120

121+
testSMTP() {
122+
let self = this;
123+
this.applicationService.getResponse('test_smtp', function(){
124+
self.messageService.add('Email sent, please check your inbox. If not, check your information under user management.');
125+
}, 0, this.settings.smtp);
126+
}
127+
121128
}

src/polyfills.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ let zhTranslations = {
273273
'smtp_server': '服务器',
274274
'smtp_port': '端口(25或587)',
275275
'smtp_account': '发送账号(Email地址)',
276-
'smtp_password': '口令'
276+
'smtp_password': '口令',
277+
'test_smtp': '测试SMTP'
277278
}
278279

279280

0 commit comments

Comments
 (0)