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.
 


3 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
  3. You have illustrated Nifi Apache very nicely in this article and interested candidates can easily understand this technology. Apache NiFi is a combined data planning platform for operating the movement of data between varying systems. It provides real-time control that makes it easier to control the movement of data between any source and any destination. If anyone willing to learn this Nifi Apache technology or upskill himself in this cloud technology one can kindly Contact
    MaxMunus

    Or kindly check Nifi Apache Video


    ReplyDelete