It is not the smell of the plant the snake is attracted to, it is rather the insects that are attracted to the strong, far-reaching smell of its flowers. Flowers develop fragrance to attract pollinators, and snakes eat pollinators, so in a way they are attracted to the tree.