Wp_mail doesnt work

f you’re using anything that allows you to configure SMTP within WordPress, take it out.

Then put everything into a function:

add_action('init','delay_until_init');
function delay_until_init(){
   // call wp_mail() here
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)