服务器忽略客户端的消息,subethasmtp服务器不打印来自客户端的消息

当我运行客户端时,它应该发送一封电子邮件到我的服务器,然后我想让我的电子邮件服务器将电子邮件的详细信息(到,从,端口,消息)打印到控制台。出于某种原因运行客户端后,服务器上没有任何明显的情况发生。subethasmtp服务器不打印来自客户端的消息

服务器

package example;

import org.subethamail.smtp.server.SMTPServer;

public class EmailServer {

public static void main(String[] args) {

MyMessageHandlerFactory myFactory = new MyMessageHandlerFactory();

SMTPServer smtpServer = new SMTPServer(myFactory);

smtpServer.setPort(25000);

smtpServer.start();

}

}

服务器输出

运行:[主要] INFO org.subethamail.smtp.server.SMTPServer - SMTP服务器 *:25000开始[有机subethamail.smtp.server.ServerThread *:25000] INFO org.subethamail.smtp.server.ServerThread - SMTP服务器*:25000 开始

客户

package example;

import java.io.IOException;

import java.util.logging.Level;

import java.util.logging.Logger;

import org.subethamail.smtp.client.*;

public class EmailClient {

public static void main(String[] args) {

try {

SMTPClient sc = new SMTPClient();

sc.close();

sc.connect("localhost", 25000);

sc.sendReceive("test");

} catch (IOException ex) {

Logger.getLogger(EmailClient.class.getName()).log(Level.SEVERE, null, ex);

}

}

}

客户端输出

运行:BUILD SUCCESSFUL(总时间:0秒)

2014-12-28

ThreaT

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值