The PM said the movie is a commendable effort to promote cleanliness.
"Good effort to further the message of cleanliness. 125 crore Indians have to continue working together to create a Swachh Bharat," Modi wrote on Twitter after Akshay shared the link to the trailer with him.
The 49-year-old actor replied, "Thank you so much honourable Sir. Hope we succeed in changing mindsets and truly making a difference."
Last month the National Award-winning actor had a meeting with the PM where they discussed the film.
The movie, directed by Shree Narayan Singh, is based on a love story against the backdrop of the Swachh Bharat Abhiyan.
"Toilet..." also stars Bhumi Pednekar, Anupam Kher and Sana Khan. The film is set to release on August 11.