|
|
|
|
@ -76,6 +76,10 @@ public class RecruitServlet extends MailerServlet
|
|
|
|
|
String fieldName = item.getFieldName();
|
|
|
|
|
fileName = item.getName();
|
|
|
|
|
file = item.get();
|
|
|
|
|
if( file == null || file.length == 0 )
|
|
|
|
|
{
|
|
|
|
|
isMultipart = false;
|
|
|
|
|
}
|
|
|
|
|
type = item.getContentType();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -96,20 +100,23 @@ public class RecruitServlet extends MailerServlet
|
|
|
|
|
String subject = "Envio de CV através do site www.siprp.pt";
|
|
|
|
|
// manda mail
|
|
|
|
|
boolean success;
|
|
|
|
|
String nome = ( String ) PROPERTIES.get( REC_NOME );
|
|
|
|
|
String telefone = ( String ) PROPERTIES.get( REC_TELEFONE );
|
|
|
|
|
String mail = ( String ) PROPERTIES.get( REC_EMAIL );
|
|
|
|
|
String nome = ( String ) parameters.get( REC_NOME );
|
|
|
|
|
String telefone = ( String ) parameters.get( REC_TELEFONE );
|
|
|
|
|
String mail = ( String ) parameters.get( REC_EMAIL );
|
|
|
|
|
if( nome == null || nome.trim().length() == 0 || telefone == null || telefone.trim().length() == 0 ||
|
|
|
|
|
mail == null || mail.trim().length() == 0 || mail.indexOf( '@' ) == -1 )
|
|
|
|
|
{
|
|
|
|
|
System.out.println( "nome: " + nome + " teefone: " + telefone + " email : " + email );
|
|
|
|
|
success = false;
|
|
|
|
|
}
|
|
|
|
|
else if( isMultipart )
|
|
|
|
|
{
|
|
|
|
|
System.out.println( "Multipart" );
|
|
|
|
|
success = sendMail( from, destination, subject, content, false, fileName, file, type );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
System.out.println( "Normal" );
|
|
|
|
|
success = sendMail( from, destination, subject, content, false );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|