If you like a one-liner configuration in wp-config try https://wordpress.org/plugins/smtp-uri/