老板为了安全把空间商的连接密码换了,但是自从换了后问题就出来了:
用户在线注册所填写的邮箱无法收到注册邮件了,但是系统还是会发一封新用户注册提示给公司的邮箱.
我用收到的提示邮件所带的密码和账号能登录公司网站,也可以在里面顺利操作.
目前我手工回复邮件给用户,为他们提供生成的账号和密码-_-|||
我尝试过联系it,他说要把resin.jar里的sendmail.java和onlinestudent.java里面的邮件服务器密码改成新的密码.
我做了但是还是没用,他好像还说要改sql里的什么...我晕了..我对这个一窍不通的..而且再也联系不上了..
希望各位高手赐教.
我把resin.jar里的错误提示截图了,在附件里,好像有2个错误.请大家抽空帮忙看看.多谢了!
附件上传不了,搞了个纳米盘的链接,请看下
8 个解决方案
#1
你改了以后重新编译部署了么?
我看异常还是用户名和密码错误
我看异常还是用户名和密码错误
#2
to rainman:
我只是用wordpad 修改了sendmail.java和onlinestudent.java 里面对应的原来的密码,把他们改成现在和空间密码一致了,然后就保存文件,重新启动resin.jar了.请告诉我这样是不是不算重新编译部署啊?不好意思,让你见笑了...我真的不懂这个...
我也觉得是用户名和密码,其他什么都没改动过~~
----------------------------------------
我找到了对应文件目录下的Authenticator.java:
----------------------------------------
package com.onlineAdmin;
/**
* <p>Title: This Class is for allowing SMTP to send a mail to outside by using JAVA</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2006 Upatham Sirichai</p>
*/
import javax.mail.*;
import java.util.*;
public class MyAuthenticator extends Authenticator{
String user;
String pwd;
public MyAuthenticator(String user,String pwd) {
this.user = user;
this.pwd = pwd;
}
public PasswordAuthentication getPasswordAuthentication(){
return new PasswordAuthentication(user,pwd);
}
}
-----------------------------------------------
还有onlinestudent.java里的应该有关系的一段:
-----------------------------------------------
/* Upatham try to create a new function for sendMailToUser */
public boolean sendMailToUser()
{
String RegInfoUser = "";
RegInfoUser = "New Online Student Registration Information:\n\n" +
"First Name: " + FirstName + "\n" +
"Last Name: " + LastName + "\n" +
"Email Address: " + EmailAddress + "\n" +
"Street Address: " + MailingStreet + "\n" +
"City: " + MailingCity + "\n" +
"State: " + MailingState + "\n" +
"Country: " + MailingCountry + "\n" +
"Zip: " + MailingZip + "\n" +
"Phone Number: " + PhoneNumber + "\n\n" +
"Username: " + this.StudentID + "\n" +
"Password: " + this.StudentID + "\n";
String FName = "";
FName = FirstName + " " + LastName;
System.out.println("My name is " + FName);
try
{
Properties props = new Properties();
props.put("mail.smtp.host", "www.domain.com");
props.put("mail.smtp.auth","true");//Use SMTP Authentication Server, It is an important part to set SMTP up for processing properly.
//Session s = Session.getInstance(props,null); //As above line, we need to authenticate user and password to allow send mail to outside.
Session s = Session.getInstance(props,new MyAuthenticator("admin","admin"));//MyAuthenticator(UserName. Password)
MimeMessage message = new MimeMessage(s);
message.setFrom(new InternetAddress("upatham@domain.com"));
Address address = new InternetAddress(EmailAddress, FName);
Address addressBCC = new InternetAddress("upatham@domain.com", "Upatham Sirichai");
if(checkEmailValidation(EmailAddress)){
//message.setRecipient(Message.RecipientType.TO, address);
message.setRecipient(Message.RecipientType.TO, address);
message.addRecipient(Message.RecipientType.BCC, addressBCC);
System.out.println("CheckEmailValidation is True");
}
else {
message.setRecipient(Message.RecipientType.TO, new InternetAddress("invalid@organize.com"));
System.out.println("CheckEmailValidation is False");
}
System.out.println("Email Address is : " + EmailAddress);
message.setSubject("Thanks for registering with us");
message.setText(" Thanks for registering. " +
" test\n\n" );
Transport.send(message);
System.out.println("Sending Mail for Registration to User is sucuessful");
return true;
}
catch (Exception e)
{
System.out.println("Sorry, error in sending Email to User");
e.printStackTrace();
return false;
}
}
// Upatham- Finish it here
/*
------------------------------------
希望你能说的再详细点,指导一下!谢谢了!
我只是用wordpad 修改了sendmail.java和onlinestudent.java 里面对应的原来的密码,把他们改成现在和空间密码一致了,然后就保存文件,重新启动resin.jar了.请告诉我这样是不是不算重新编译部署啊?不好意思,让你见笑了...我真的不懂这个...
我也觉得是用户名和密码,其他什么都没改动过~~
----------------------------------------
我找到了对应文件目录下的Authenticator.java:
----------------------------------------
package com.onlineAdmin;
/**
* <p>Title: This Class is for allowing SMTP to send a mail to outside by using JAVA</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2006 Upatham Sirichai</p>
*/
import javax.mail.*;
import java.util.*;
public class MyAuthenticator extends Authenticator{
String user;
String pwd;
public MyAuthenticator(String user,String pwd) {
this.user = user;
this.pwd = pwd;
}
public PasswordAuthentication getPasswordAuthentication(){
return new PasswordAuthentication(user,pwd);
}
}
-----------------------------------------------
还有onlinestudent.java里的应该有关系的一段:
-----------------------------------------------
/* Upatham try to create a new function for sendMailToUser */
public boolean sendMailToUser()
{
String RegInfoUser = "";
RegInfoUser = "New Online Student Registration Information:\n\n" +
"First Name: " + FirstName + "\n" +
"Last Name: " + LastName + "\n" +
"Email Address: " + EmailAddress + "\n" +
"Street Address: " + MailingStreet + "\n" +
"City: " + MailingCity + "\n" +
"State: " + MailingState + "\n" +
"Country: " + MailingCountry + "\n" +
"Zip: " + MailingZip + "\n" +
"Phone Number: " + PhoneNumber + "\n\n" +
"Username: " + this.StudentID + "\n" +
"Password: " + this.StudentID + "\n";
String FName = "";
FName = FirstName + " " + LastName;
System.out.println("My name is " + FName);
try
{
Properties props = new Properties();
props.put("mail.smtp.host", "www.domain.com");
props.put("mail.smtp.auth","true");//Use SMTP Authentication Server, It is an important part to set SMTP up for processing properly.
//Session s = Session.getInstance(props,null); //As above line, we need to authenticate user and password to allow send mail to outside.
Session s = Session.getInstance(props,new MyAuthenticator("admin","admin"));//MyAuthenticator(UserName. Password)
MimeMessage message = new MimeMessage(s);
message.setFrom(new InternetAddress("upatham@domain.com"));
Address address = new InternetAddress(EmailAddress, FName);
Address addressBCC = new InternetAddress("upatham@domain.com", "Upatham Sirichai");
if(checkEmailValidation(EmailAddress)){
//message.setRecipient(Message.RecipientType.TO, address);
message.setRecipient(Message.RecipientType.TO, address);
message.addRecipient(Message.RecipientType.BCC, addressBCC);
System.out.println("CheckEmailValidation is True");
}
else {
message.setRecipient(Message.RecipientType.TO, new InternetAddress("invalid@organize.com"));
System.out.println("CheckEmailValidation is False");
}
System.out.println("Email Address is : " + EmailAddress);
message.setSubject("Thanks for registering with us");
message.setText(" Thanks for registering. " +
" test\n\n" );
Transport.send(message);
System.out.println("Sending Mail for Registration to User is sucuessful");
return true;
}
catch (Exception e)
{
System.out.println("Sorry, error in sending Email to User");
e.printStackTrace();
return false;
}
}
// Upatham- Finish it here
/*
------------------------------------
希望你能说的再详细点,指导一下!谢谢了!
#3
.Java文件只是源文件,编译成.class文件以后才能执行,你这个改法我还真没见过,也不知道会不会自动编译
不过你应该重新从源文件重新打一个resin.jar包 然后 替换这个resin.jar才能起作用。
不过你应该重新从源文件重新打一个resin.jar包 然后 替换这个resin.jar才能起作用。
#4
是不是用机器上netbeans ide 6.1这个软件把.java编译成.class 然后把新的class放到resin对应的文件夹下,再重启 resin?
还是要学习怎么重新把所有源文件打一个resin.jar包?
请指点,谢谢
还是要学习怎么重新把所有源文件打一个resin.jar包?
请指点,谢谢
#5
你好呀~还是上次的问题,请教下:我发现我修改resin对应文件夹下的class文件后网页功能能改变,看来我只要把修改过的单个java文件编译成class文件覆盖原来的就可以了...但是我发现只有jbuilder4能够顺利读取我之前.java文件,不报错.但是我不知道怎么用jbuilder4把java单个文件转化成class文件,可以教下我吗,或者用其他方法也行,我用javac命令或者netbean这种软件编译onlinestudent.java文件时报错的很厉害100个..都是符号没有找到和没有包....
#6
up
#7
up
#8
#1
你改了以后重新编译部署了么?
我看异常还是用户名和密码错误
我看异常还是用户名和密码错误
#2
to rainman:
我只是用wordpad 修改了sendmail.java和onlinestudent.java 里面对应的原来的密码,把他们改成现在和空间密码一致了,然后就保存文件,重新启动resin.jar了.请告诉我这样是不是不算重新编译部署啊?不好意思,让你见笑了...我真的不懂这个...
我也觉得是用户名和密码,其他什么都没改动过~~
----------------------------------------
我找到了对应文件目录下的Authenticator.java:
----------------------------------------
package com.onlineAdmin;
/**
* <p>Title: This Class is for allowing SMTP to send a mail to outside by using JAVA</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2006 Upatham Sirichai</p>
*/
import javax.mail.*;
import java.util.*;
public class MyAuthenticator extends Authenticator{
String user;
String pwd;
public MyAuthenticator(String user,String pwd) {
this.user = user;
this.pwd = pwd;
}
public PasswordAuthentication getPasswordAuthentication(){
return new PasswordAuthentication(user,pwd);
}
}
-----------------------------------------------
还有onlinestudent.java里的应该有关系的一段:
-----------------------------------------------
/* Upatham try to create a new function for sendMailToUser */
public boolean sendMailToUser()
{
String RegInfoUser = "";
RegInfoUser = "New Online Student Registration Information:\n\n" +
"First Name: " + FirstName + "\n" +
"Last Name: " + LastName + "\n" +
"Email Address: " + EmailAddress + "\n" +
"Street Address: " + MailingStreet + "\n" +
"City: " + MailingCity + "\n" +
"State: " + MailingState + "\n" +
"Country: " + MailingCountry + "\n" +
"Zip: " + MailingZip + "\n" +
"Phone Number: " + PhoneNumber + "\n\n" +
"Username: " + this.StudentID + "\n" +
"Password: " + this.StudentID + "\n";
String FName = "";
FName = FirstName + " " + LastName;
System.out.println("My name is " + FName);
try
{
Properties props = new Properties();
props.put("mail.smtp.host", "www.domain.com");
props.put("mail.smtp.auth","true");//Use SMTP Authentication Server, It is an important part to set SMTP up for processing properly.
//Session s = Session.getInstance(props,null); //As above line, we need to authenticate user and password to allow send mail to outside.
Session s = Session.getInstance(props,new MyAuthenticator("admin","admin"));//MyAuthenticator(UserName. Password)
MimeMessage message = new MimeMessage(s);
message.setFrom(new InternetAddress("upatham@domain.com"));
Address address = new InternetAddress(EmailAddress, FName);
Address addressBCC = new InternetAddress("upatham@domain.com", "Upatham Sirichai");
if(checkEmailValidation(EmailAddress)){
//message.setRecipient(Message.RecipientType.TO, address);
message.setRecipient(Message.RecipientType.TO, address);
message.addRecipient(Message.RecipientType.BCC, addressBCC);
System.out.println("CheckEmailValidation is True");
}
else {
message.setRecipient(Message.RecipientType.TO, new InternetAddress("invalid@organize.com"));
System.out.println("CheckEmailValidation is False");
}
System.out.println("Email Address is : " + EmailAddress);
message.setSubject("Thanks for registering with us");
message.setText(" Thanks for registering. " +
" test\n\n" );
Transport.send(message);
System.out.println("Sending Mail for Registration to User is sucuessful");
return true;
}
catch (Exception e)
{
System.out.println("Sorry, error in sending Email to User");
e.printStackTrace();
return false;
}
}
// Upatham- Finish it here
/*
------------------------------------
希望你能说的再详细点,指导一下!谢谢了!
我只是用wordpad 修改了sendmail.java和onlinestudent.java 里面对应的原来的密码,把他们改成现在和空间密码一致了,然后就保存文件,重新启动resin.jar了.请告诉我这样是不是不算重新编译部署啊?不好意思,让你见笑了...我真的不懂这个...
我也觉得是用户名和密码,其他什么都没改动过~~
----------------------------------------
我找到了对应文件目录下的Authenticator.java:
----------------------------------------
package com.onlineAdmin;
/**
* <p>Title: This Class is for allowing SMTP to send a mail to outside by using JAVA</p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2006 Upatham Sirichai</p>
*/
import javax.mail.*;
import java.util.*;
public class MyAuthenticator extends Authenticator{
String user;
String pwd;
public MyAuthenticator(String user,String pwd) {
this.user = user;
this.pwd = pwd;
}
public PasswordAuthentication getPasswordAuthentication(){
return new PasswordAuthentication(user,pwd);
}
}
-----------------------------------------------
还有onlinestudent.java里的应该有关系的一段:
-----------------------------------------------
/* Upatham try to create a new function for sendMailToUser */
public boolean sendMailToUser()
{
String RegInfoUser = "";
RegInfoUser = "New Online Student Registration Information:\n\n" +
"First Name: " + FirstName + "\n" +
"Last Name: " + LastName + "\n" +
"Email Address: " + EmailAddress + "\n" +
"Street Address: " + MailingStreet + "\n" +
"City: " + MailingCity + "\n" +
"State: " + MailingState + "\n" +
"Country: " + MailingCountry + "\n" +
"Zip: " + MailingZip + "\n" +
"Phone Number: " + PhoneNumber + "\n\n" +
"Username: " + this.StudentID + "\n" +
"Password: " + this.StudentID + "\n";
String FName = "";
FName = FirstName + " " + LastName;
System.out.println("My name is " + FName);
try
{
Properties props = new Properties();
props.put("mail.smtp.host", "www.domain.com");
props.put("mail.smtp.auth","true");//Use SMTP Authentication Server, It is an important part to set SMTP up for processing properly.
//Session s = Session.getInstance(props,null); //As above line, we need to authenticate user and password to allow send mail to outside.
Session s = Session.getInstance(props,new MyAuthenticator("admin","admin"));//MyAuthenticator(UserName. Password)
MimeMessage message = new MimeMessage(s);
message.setFrom(new InternetAddress("upatham@domain.com"));
Address address = new InternetAddress(EmailAddress, FName);
Address addressBCC = new InternetAddress("upatham@domain.com", "Upatham Sirichai");
if(checkEmailValidation(EmailAddress)){
//message.setRecipient(Message.RecipientType.TO, address);
message.setRecipient(Message.RecipientType.TO, address);
message.addRecipient(Message.RecipientType.BCC, addressBCC);
System.out.println("CheckEmailValidation is True");
}
else {
message.setRecipient(Message.RecipientType.TO, new InternetAddress("invalid@organize.com"));
System.out.println("CheckEmailValidation is False");
}
System.out.println("Email Address is : " + EmailAddress);
message.setSubject("Thanks for registering with us");
message.setText(" Thanks for registering. " +
" test\n\n" );
Transport.send(message);
System.out.println("Sending Mail for Registration to User is sucuessful");
return true;
}
catch (Exception e)
{
System.out.println("Sorry, error in sending Email to User");
e.printStackTrace();
return false;
}
}
// Upatham- Finish it here
/*
------------------------------------
希望你能说的再详细点,指导一下!谢谢了!
#3
.Java文件只是源文件,编译成.class文件以后才能执行,你这个改法我还真没见过,也不知道会不会自动编译
不过你应该重新从源文件重新打一个resin.jar包 然后 替换这个resin.jar才能起作用。
不过你应该重新从源文件重新打一个resin.jar包 然后 替换这个resin.jar才能起作用。
#4
是不是用机器上netbeans ide 6.1这个软件把.java编译成.class 然后把新的class放到resin对应的文件夹下,再重启 resin?
还是要学习怎么重新把所有源文件打一个resin.jar包?
请指点,谢谢
还是要学习怎么重新把所有源文件打一个resin.jar包?
请指点,谢谢
#5
你好呀~还是上次的问题,请教下:我发现我修改resin对应文件夹下的class文件后网页功能能改变,看来我只要把修改过的单个java文件编译成class文件覆盖原来的就可以了...但是我发现只有jbuilder4能够顺利读取我之前.java文件,不报错.但是我不知道怎么用jbuilder4把java单个文件转化成class文件,可以教下我吗,或者用其他方法也行,我用javac命令或者netbean这种软件编译onlinestudent.java文件时报错的很厉害100个..都是符号没有找到和没有包....
#6
up
#7
up