How to send post notification when a Author and Contributor post?

Try this. I’ve tested it and it works although your questions is not so clear (snippet VS description).

function wpkse_144405_on_post_publish( $ID, $post ) {
    $users = get_users( array( 'fields' => array( 'user_email' ) ) );   
    $email_subject="New post has been published";
    $message .= 'New post has been published: ' . $post->post_title 
             .  ' You can preview it here: ' . get_permalink( $ID );

    foreach( $users as $user ) {
        wp_mail( $user->user_email, $email_subject, $message );
    }
}
add_action(  'publish_post',  'wpkse_144405_on_post_publish', 10, 2 );

Reference: wp_mail(), Post Status Transitions