• I have a code that registers a user, user details comes from url variables. Now I’m sending user’s username and password tru email, but emails goes to spam folder in gmail.. On ymail it works fine. I also tried installing wp-smtp but doesn’t work. Below is my code and my wp-smtp settings.

    http://postimg.org/image/yry5n2vuf/

    <?php 
    
    $Input = (object)$_GET;
    
    $Email = $Input->inf_field_Email;
    $FirstName = $Input->inf_field_FirstName;
    $LastName = $Input->inf_field_LastName;
    
    if ( ! email_exists( $Email )) {
     $Password = wp_generate_password( $length=12, $include_standard_special_chars=false );
     wp_create_user( $Email, $Password, $Email );
     $Domain =  preg_replace( "/^www\./" , "" , $_SERVER["SERVER_NAME"] );
     $Title = "Welcome : New Member";
     $Message = "Hi ". $FirstName .",\n \nTom Cronin here, co-founder of Science of Stillness. \n \nI just wanted to send you a quick message to welcome you to the Science of Stillness community! \n \n Thanks so much for putting your faith in us. \n \nTo get started, simply follow the access details you received in the order confirmation email. Along with the confirmation email, you should have also received a receipt from One Great Find. Save this with your records. \n \nI am ao so excited to have you on board John! \n \nSincerely, \n \nTom \n \nUsername: " . $Email . " \nPassword: " . $Password . " \nClick the following link to visit our member's area, http://stillnessproject.com/";
     $headers = "From: tom@stillnessproject.com\r\n";
     $headers .= "Reply-To: tom@stillnessproject.com\r\n";
     $headers .= "Return-Path: tom@stillnessproject.com\r\n";
     $headers .= "CC: {$Email}\r\n";
     $headers .= "BCC: {$Email}\r\n";
     wp_mail( $Email , $Title , $Message , $headers );
    }
    
    ?>
  • The topic ‘Email goes to spam folder in gmail’ is closed to new replies.