php - How to prevent mail from going to spam? -
this question has answer here:
below header sent user:
$to="$mail"; $sub="thank you!"; $headers = "mime-version: 1.0\r\n"; $headers .= "content-type:text/html; charset=iso-8859-1\r\n"; $headers .= 'from: example.com <noreply@example.com>' . "\r\n"; $msg="dear $nme ,<br/> received request recover password.<br/> password $pss ."; $response =@mail($to,$sub,$msg,$headers);
if send through diff sever goes inbox. how can prevent email going spam?
$to='example@gmail.com'; $subject='application form '; $message='testing'; $headers = 'mime-version: 1.0' . "\r\n"; $headers .= 'content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'from: admin <admin@gmail.com>' . "\r\n"; if(mail($to,$subject,$message,$headers)) { echo "mail sent.."; exit; }
it works me. can use smtp mail instead of this.
Comments
Post a Comment