php - How to stop mail goes spam folder? -
php - How to stop mail goes spam folder? -
this question has reply here:
how create sure email send programmatically not automatically marked spam? 18 answerswhen trigger mail service function , mail service goes 'spam' folder not 'inbox'. can u please figure out whats problem?
function send_user_email($mail, $to_email,$password, $first_name) { $html = "hi $first_name, <br /><br />"; $html = $html . "<p> have been registered system. please find login details below. </p>"; $html = $html . "user name - $to_email <br />"; $html = $html . "password - $password <br /> <br />"; $html = $html . "regards, <br />"; $html = $html . "team"; $mail->issmtp(); // telling class utilize smtp $mail->host = "smtpout.xxx.xxx.xxx"; // sets gmail smtp server // $mail->host= "stmp.gmail.com"; // smtp server $mail->smtpauth = true; // enable smtp authentication $mail->smtpsecure = "ssl"; // sets prefix servier $mail->port = xxx; // set smtp port gmail server $mail->username = "mailid"; // gmail username $mail->password = 'password';// gmail password $mail->from = "mailid"; $mail->fromname = "name"; $mail->subject = "user invitation email"; $mail->altbody = ""; // optional, comment out , test $mail->ishtml(true); $mail->body = nl2br($html); $mail->addaddress($to_email); $mail->send(); // send message }
few things can verify :)
have html , text content. try add together little quality html body not br's. verify smtp server utilize set-upped properly. if utilize paid smtp's not problem, if build may have problems. spf records often, problem if missing mail service can/will counted spam. php email gmail phpmailer
Comments
Post a Comment