"""from xsmtplib import SMTP
server = SMTP(proxy_host,proxy_port,host,port,timeout)
server.sendmail("aaaa@gmail.com", "bbbb@gmail.com", "Test Msg")
server.quit()"""
下面的代码,用于通过代理连接SMTP服务器
import { Component, OnInit } from '@angular/core';
import { Router, RoutesRecognized } from '@angular/router';
import { filter, pairwise } from 'rxjs/operators';
export class AppComponent implements OnInit {
constructor (
public router: Router
) {
}
ngOnInit() {
this.router.events
.pipe(filter((e: any) => e instanceof RoutesRecognized),
pairwise()
).subscribe((e: any) => {
console.log(e[0].urlAfterRedirects); // previous url
});
}