The method put(String, String) is undefined for the type Properties

2 respostas
M

Pessoal, estou tentando enviar enviar email com servlets mas aparece alguns erros que qdo eu fazio direto no jsp não tinha, alguém sabe o pq desses erros?

  • The method put(String, String) is undefined for the type Properties

  • The method getInstance(Properties, Authenticator) in the type Session is not applicable for the arguments (Properties, null)

  • Line breakpoint:CqaAprova [line: 83] - processRequest(HttpServletRequest, HttpServletResponse)

Properties props = new Properties();
props.put("mail.smtp.host", "mailhost.sjtc.xxx.com");
	    		  Session s = Session.getInstance(props,null);
	    		  
	    		  MimeMessage message = new MimeMessage(s);

	    		  InternetAddress from = new InternetAddress("[email removido]");
	    		  message.setFrom(from);
	    		  InternetAddress to = new InternetAddress(rs_emailC.getString("email"));
	    		  InternetAddress Bcc = new InternetAddress("[email removido]");
	    		  message.addRecipient(Message.RecipientType.TO, to);
	    		  message.addRecipient(Message.RecipientType.BCC, Bcc);

Desde já agradeço a ajuda!

Marcos

2 Respostas

T

Você fez o import de java.util.Properties?

M

Putz é verdade… esqueci deste detalhe…

Obrigado

Criado 6 de agosto de 2009
Ultima resposta 6 de ago. de 2009
Respostas 2
Participantes 2