Problem sending email by Demoiselle Mail

Asked

Viewed 142 times

1

Good afternoon Personal,

I am following the steps to send e-mail by e-mail by e-mail, but I was not successful. I performed all the settings proposed in the documentation, in the eclipse console it says that the message was sent, but no e-mail arrived.

Below is the documentation link: http://demoiselle.sourceforge.net/docs/components/junit/reference/2.3.1/html/mail-master.html

Below are the implementations I made in a test project.

pom.xml

    <dependency>
        <groupId>br.gov.frameworkdemoiselle.component</groupId>
        <artifactId>demoiselle-mail</artifactId>
        <version>2.1.0</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>



Demoiselle.properties

# Configurações do Servidor de E-mail
[email protected]
frameworkdemoiselle.mail.password=minha senha
frameworkdemoiselle.mail.serverHost=smtp.gmail.com
frameworkdemoiselle.mail.serverPort=465
frameworkdemoiselle.mail.enable.ssl=true
frameworkdemoiselle.mail.auth=true
frameworkdemoiselle.mail.type=local
frameworkdemoiselle.mail.enable.tls=false
frameworkdemoiselle.mail.require.tls=false



Test class

import java.io.Serializable;

import javax.inject.Inject;

import br.gov.frameworkdemoiselle.mail.Mail;
import br.gov.frameworkdemoiselle.stereotype.ViewController;

@ViewController
public class TesteView implements Serializable {

private static final long serialVersionUID = 1L;

@Inject
private Mail mail;

public void enviar() {
    mail.from("[email protected]")
        .to("[email protected]")
        .body().text("Primeiro E-mail")
        .subject("Assunto")
        .importance().high().send();
}
}



On the index.jsf page I just entered a commandButton

<ui:composition xmlns="http://www.w3.org/1999/xhtml"  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html"                     
                xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/template/main.xhtml">
 <ui:define name="body">
     <p:panel>
        <p:commandButton value="email" actionListener="#{testeView.enviar()}" />
     </p:panel>

 </ui:define>
</ui:composition>



When I start the server and try to send the email, the eclipse console returns that the message was sent, but I do not receive any e-mail:

14:39:47,595 WARN  [br.gov.frameworkdemoiselle.internal.implementation.ConfigurationLoader] (http--0.0.0.0-8080-5) Não é necessário adicionar o ponto após o prefixo para uma classe de configuração. É recomendado que sejam retirados, pois poderão causar erros em versões futuras do  Framework.
14:39:47,674 INFO  [br.gov.frameworkdemoiselle.mail.internal.Dispatcher] (http--0.0.0.0-8080-5) Preparing to send message
14:39:47,690 INFO  [br.gov.frameworkdemoiselle.mail.internal.Dispatcher] (http--0.0.0.0-8080-5) Message Sent!



Follow the link to download the project:
https://www.dropbox.com/s/0aqa1lsskh9buod/testeEmail.7z?dl=0

1 answer

1


In the user list of the project was commented on an implicit dependency that hindered execution. Using as a basis your project I did some tests by deleting the library. In this link the modified project: https://www.dropbox.com/s/vfhdsoveukua6ey/testeEmail.7z?dl=0

I created a unit test to facilitate execution, and with some providers like yahoo and gmail it worked. Including an internal here in SERPRO that is Expresso. There are cases where there is a firewall or proxy that can prevent communication. But error must occur in these cases.

This dependency issue is a component bug. If you want to collaborate you can register http://tracker.frameworkdemoiselle.gov.br

Browser other questions tagged

You are not signed in. Login or sign up in order to post.