Is the content in functions.php visible?

[ad_1]

Hi,

I’m having problems with the emails headers sent from woocommerce.

I’ve found a solution in this forum and implies adding the email password in the functions.php file.

Is this safe? Can anyone see my email password? If not, how can I solve this?

Thanks in advance.

This is the code:

function my_phpmailer_example( $phpmailer ) {
    $phpmailer->isSMTP();     
    $phpmailer->Host="smtp.example.com";
    $phpmailer->SMTPAuth = true; // Ask it to use authenticate using the Username and Password properties
    $phpmailer->Port = 25;
    $phpmailer->Username="yourusername";
    $phpmailer->Password = 'yourpassword';
 
    // Additional settings…
    //$phpmailer->SMTPSecure="tls"; // Choose 'ssl' for SMTPS on port 465, or 'tls' for SMTP+STARTTLS on port 25 or 587
    //$phpmailer->From = "[email protected]";
    //$phpmailer->FromName = "Your Name";
}
add_action( 'phpmailer_init', 'my_phpmailer_example' );

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer