
正文
java代码实现邮箱登陆 java实现邮箱功能
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
java实现登录邮箱,点击链接修改密码
点击链接--跳转到修改密码的页面--而后输入原来密码,并输入两次新的密码--
点击修改,经过判断,符合要求,提示密码修改成功--下次登录输入新密码即可。
服务器如何解析java代码实现邮箱登陆?java代码实现邮箱登陆?
这个是什么意思。
相关问答
Q1: 输入一段电子邮箱的地址,要求如下,IT大神教教我,怎么做,JAVA的
hi:你好:
你这道题目只要涉及到字符串的操作;重点关注下String类中的一些方法,下面是我帮你实现的代码样例,请参考:
// 字符串判断,邮箱地址
class MailRun implements Runnable {
private Scanner scanner;
private String Mail;
public void setMail(String Mail) {
this.Mail = Mail;
}
public String getMail() {
return Mail;
}
public void run() {
try {
System.out.println("请输入...");
scanner = new Scanner(System.in);
this.setMail(scanner.nextLine());
// System.out.println(this.getMail());
String com = ".com";
String cn = ".cn";
String net = ".net";
String org = ".org";
// System.out.println(this.getMail().substring(this.getMail().length()-4,
// this.getMail().length()));
String str1 = "@";
String str2 = ".";
int a = 0;
int b = 0;
// System.out.println(this.getMail().indexOf(str1));
// 当有“@”时才输出,indexOf!=-1
int Counta = this.getMail().indexOf("@");
int Countb = this.getMail().indexOf(".");
// 判断必须包含@ 至少有一个. @的位置在.的前面
if ((this.getMail().indexOf(str1) != -1) (this.getMail().indexOf(str2) != -1) (Counta Countb)) {
// 判断只有一个@
while (this.getMail().indexOf(str1, b) = 0 b this.getMail().length()) {
a++;
b = this.getMail().indexOf(str1, b) + str1.length();
}
// @的出现次数必须小于2
if (a 2) {
// System.out.println(this.getMail());
// @与.之间存在字符
if ((this.getMail().indexOf(str2) - this.getMail().indexOf(str1)) 2) {
// 用户地址长度,不能超过150个文字
if (this.getMail().indexOf(str1) = 150 this.getMail().indexOf(str1) 0) {
// 地址最后为.com
if (this.getMail().substring(this.getMail().length() - 4, this.getMail().length())
.equals(com)) {
System.out.println("邮箱为:" + this.getMail());
// 地址最后为.cn
} else if (this.getMail().substring(this.getMail().length() - 3, this.getMail().length())
.equals(cn)) {
System.out.println("邮箱为:" + this.getMail());
// 地址最后为.net
} else if (this.getMail().substring(this.getMail().length() - 4, this.getMail().length())
.equals(net)) {
System.out.println("邮箱为:" + this.getMail());
// 地址最后为.org
} else if (this.getMail().substring(this.getMail().length() - 4, this.getMail().length())
.equals(org)) {
System.out.println("邮箱为:" + this.getMail());
} else {
System.out.println("邮箱后缀不正确!");
}
} else {
System.out.println("用户名称,字符最长不能超出150个字符,字符最短不能小于1个字符");
}
} else {
System.out.println("请检查域名,@与.之间存在字符!");
}
} else {
System.out.println("请检查是否重复输入@");
}
} else {
System.out.println("请检查是否包含@ 和 . ;同时检查@是否在.的前面");
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Q2: java如何将电子邮箱的登陆名,域名,主机名输出
1、打开eclipse,然后在主函数中书写这条语句即可输出,输出的内容要用双引号引起来。
2、接着运行java程序,然后就会直接在控制台打印我们的输出的电子邮箱的登陆名,域名,主机名内容。
3、而java获取从键盘的内容则需要导入一个类。
4、然后写获取输入的代码。
5、之后,运行java程序,看到有提示我们输入,然后我们使用键盘向控制台里面输入内容。
Q3: 能否用java实现像outlook登陆邮箱一样登陆校内
这个是完全可以的,可以用web或者swing作为前台 然后可以调用java的mail包进行发送 如果想收的话 建议自己架设邮件服务器 阿帕奇有提供的免费邮件服务器的一个service 代码 自己架设一个 想怎么用就怎么用
Q4: 求助:java编程,用户注册后根据自己注册的邮箱跳转到对应的邮箱门户进行登陆。
这个东西就没有办法解决了,你只能是列出一些人们常用的邮箱对应的门户网站,而有些人使用的是自己的企业邮局,你是没有办法知道他的域名地址是什么的!
Q5: java 如何实现登录139邮箱 并判断是否登录成功?
如果你是用socket传输指令法师登陆邮箱的话,那么有专门的命令stat来查看你的登陆是否成功的
一个例子
public static void main(String[] args){
if(args.length!=3){
System.out.println("USE: java POP3Demo mailhost user password");
}
new POP3Demo().receive(args[0],args[1],args[2]);
}
/**
*br方法说明:接收邮件
*br输入参数:String popServer 服务器地址
*br输入参数:String popUser 邮箱用户名
*br输入参数:String popPassword 邮箱密码
*br返回类型:
*/
public static void receive (String popServer, String popUser, String popPassword)
{
String POP3Server = popServer;
int POP3Port = 110;
Socket client = null;
try
{
// 创建一个连接到POP3服务程序的套接字。
client = new Socket (POP3Server, POP3Port);
//创建一个BufferedReader对象,以便从套接字读取输出。
InputStream is = client.getInputStream ();
BufferedReader sockin;
sockin = new BufferedReader (new InputStreamReader (is));
//创建一个PrintWriter对象,以便向套接字写入内容。
OutputStream os = client.getOutputStream ();
PrintWriter sockout;
sockout = new PrintWriter (os, true); // true for auto-flush
// 显示POP3握手信息。
System.out.println ("S:" + sockin.readLine ());
/*-- 与POP3服务器握手过程 --*/
System.out.print ("C:");
String cmd = "user "+popUser;
// 将用户名发送到POP3服务程序。
System.out.println (cmd);
sockout.println (cmd);
// 读取POP3服务程序的回应消息。
String reply = sockin.readLine ();
System.out.println ("S:" + reply);
System.out.print ("C:");
cmd = "pass ";
// 将密码发送到POP3服务程序。
System.out.println(cmd+"*********");
sockout.println (cmd+popPassword);
// 读取POP3服务程序的回应消息。
reply = sockin.readLine ();
System.out.println ("S:" + reply);
System.out.print ("C:");
cmd = "stat";
// 获取邮件数据。
System.out.println(cmd);
sockout.println (cmd);
// 读取POP3服务程序的回应消息。
reply = sockin.readLine ();
System.out.println ("S:" + reply);
if(reply==null) return;
System.out.print ("C:");
cmd = "retr 1";
// 将接收第一丰邮件命令发送到POP3服务程序。
System.out.println(cmd);
sockout.println (cmd);
// 输入了RETR命令并且返回了成功的回应码,持续从套接字读取输出,
// 直到遇到CRLF.CRLF。这时从套接字读出的输出就是邮件的内容。
if (cmd.toLowerCase ().startsWith ("retr")
reply.charAt (0) == '+')
do
{
reply = sockin.readLine ();
System.out.println ("S:" + reply);
if (reply != null reply.length () 0)
if (reply.charAt (0) == '.')
break;
}
while (true);
cmd = "quit";
// 将命令发送到POP3服务程序。
System.out.print (cmd);
sockout.println (cmd);
}
catch (IOException e)
{
System.out.println (e.toString ());
}
finally
{
try
{ if (client != null)
client.close ();
}
catch (IOException e)
{
}
}
}
}
关于java代码实现邮箱登陆和java实现邮箱功能的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。





