Viewing 6 replies - 1 through 6 (of 6 total)
  • +1 on this issue.

    Swedish and Danish characters does not work

    ??? becomes ?…???–

    ?? becomes ???|?

    Thread Starter lgustaw

    (@lgustaw)

    I found a solution :-),
    use a different alternative plugin that encodes correctly eg. https://www.ads-software.com/plugins/wp-smtp/

    I fixed the plugin, replace row ~334 in file easy-wp-smtp.php with this, it also fixes the apostrophe bug in the other thread.

    /**
     * Function to test mail sending
     * @return text or errors
     */
    if ( ! function_exists( 'swpsmtp_test_mail' ) ) {
    	function swpsmtp_test_mail( $to_email, $subject, $message ) {
    		$errors = '';
    
    		$swpsmtp_options = get_option( 'swpsmtp_options' );
    
    		require_once( ABSPATH . WPINC . '/class-phpmailer.php' );
    		$mail = new PHPMailer();
    
    		$from_name  = stripslashes( $swpsmtp_options['from_name_field'] );
    		$from_email = sanitize_email( $swpsmtp_options['from_email_field'] ); 
    
    		$mail->IsSMTP();
    
    		/* If using smtp auth, set the username & password */
    		if( 'yes' == $swpsmtp_options['smtp_settings']['autentication'] ){
    			$mail->SMTPAuth = true;
    			$mail->Username = $swpsmtp_options['smtp_settings']['username'];
    			$mail->Password = $swpsmtp_options['smtp_settings']['password'];
    		}
    
    		/* Set the SMTPSecure value, if set to none, leave this blank */
    		if ( $swpsmtp_options['smtp_settings']['type_encryption'] !== 'none' ) {
    			$mail->SMTPSecure = $swpsmtp_options['smtp_settings']['type_encryption'];
    		}
    
    		/* Set the other options */
    		$mail->Host = $swpsmtp_options['smtp_settings']['host'];
    		$mail->Port = $swpsmtp_options['smtp_settings']['port'];
    		$mail->SetFrom( $from_email, $from_name );
    		$mail->isHTML( true );
    		$mail->Subject = apply_filters('the_title', utf8_decode( $subject ) );
    		$mail->MsgHTML( apply_filters('the_content', utf8_decode( $message ) ) );
    		$mail->AddAddress( sanitize_email( $to_email ) );
    		$mail->SMTPDebug = 0;
    
    		/* Send mail and return result */
    		if ( ! $mail->Send() )
    			$errors = $mail->ErrorInfo;
    
    		$mail->ClearAddresses();
    		$mail->ClearAllRecipients();
    
    		if ( ! empty( $errors ) ) {
    			return $errors;
    		}
    		else{
    			return 'Test mail was sent';
    		}
    	}
    }

    Hi, is there any plan from the author to add this fix to the plugin? I have to deploy it in several sites and a manual edit is a burden…

    Hi, I have just release an update to fix this issue. Please update the plugin and see how it goes.

    Thanks!!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Incorrect character encoding’ is closed to new replies.