1700479641
1700479642
public class Postfix extends MailServer{
1700479643
1700479644
public Postfix(MailTemplate_m){
1700479645
1700479646
super(_m);
1700479647
1700479648
}
1700479649
1700479650
//修正邮件发送程序
1700479651
1700479652
public void sendMail(){
1700479653
1700479654
//增加邮件服务器信息
1700479655
1700479656
String context=“Received:from XXXX(unknown[xxx.xxx.xxx.xxx])by
1700479657
1700479658
aaa.aaa.com(Postfix)with ESMTP id 8DBCD172B8\n”;
1700479659
1700479660
super.m.add(context);
1700479661
1700479662
super.sendMail();
1700479663
1700479664
}
1700479665
1700479666
}
1700479667
1700479668
为什么要覆写sendMail程序呢?这是因为每个邮件服务器在发送邮件时都会在邮件内容上留下自己的标志,一是广告作用,二是为了互联网上统计需要,三是方便同质软件的共振。我们再来看SendMail邮件服务器的实现,如代码清单33-9所示。
1700479669
1700479670
代码清单33-9 SendMail邮件服务器
1700479671
1700479672
public class SendMail extends MailServer{
1700479673
1700479674
//传递一封邮件
1700479675
1700479676
public SendMail(MailTemplate_m){
1700479677
1700479678
super(_m);
1700479679
1700479680
}
1700479681
1700479682
//修正邮件发送程序
1700479683
1700479684
@Override
1700479685
1700479686
public void sendMail(){
1700479687
1700479688
//增加邮件服务器信息
1700479689
1700479690
super.m.add(“Received:(sendmail);7 Nov 2009 04:14:44+0100”);
[
上一页 ]
[ :1.700479641e+09 ]
[
下一页 ]