Tuesday, December 29, 2020

Sending emails uisng Apache Nifi

In this post, we will see how one can send email to others using processors provided by Apache Nifi. 

Assume, we want to send email from sendername@gmail.com to receivername@gmail.com.

For this 

  • we need to have the login credential for sendername@gmail.com email account. 
  • Need to set Apache Nifi running.
In this demonstration, we will generate dummy random files and send them to receivername@gmail.com.

Steps:

  1. Access Nifi user interface.
  2. Bring GnerateFlowFile processor into the canvas 
  3. Configure  GnerateFlowFile processor as shown in below figure.

Figure : Configuration of GenerateFlowFile processor

  1. Now bring PutMail processor into the canvas
  2. Configure  PutMail processor as shown in below figure.
Figure : Configuration of PutMail processor
  1. Connect GnerateFlowFile to PutMail processor as shown below.
  1. Now configure your gmail account and allow Nifi to login and send emails on your behalf.
  2. For above, Sign in to your Gmail account
  3. Now visit below link: https://myaccount.google.com/security?rapt=AEjHL4MPOlIXcaCs-jP2OdP7-Sg31QTMNhC7WbO6I08_VwUe2u5--dz6TedtBcYIYo0Ch2IfRYqErD677n9CCBrPnYgRnHcpXw
  4. Make sure that Less secure app access is ON as shown in below:

  1. Now start above processors and you should be receiving the dummy emails.

 

- That's all, comment if you face any difficulties.
 


2 comments:

  1. I am getting ssl hand shake exception,while using port 587 with public ip address as host

    ReplyDelete
  2. What will be SMTP port name and port number in PutEmail processor. Also please tell why will we need GenerateFlowFile processor.

    ReplyDelete