php - How to get my emails delivered to the inbox instead of the spam folder? -
i can try this:
$name = @trim(stripslashes($_post['name'])); $from = @trim(stripslashes($_post['email'])); $subject = @trim(stripslashes($_post['subject'])); $message = @trim(stripslashes($_post['message'])); $to = 'email@email.com';//replace email $headers = array(); $headers[] = "mime-version: 1.0"; $headers[] = "content-type: text/plain; charset=iso-8859-1"; $headers[] = "from: {$name} <{$from}>"; $headers[] = "reply-to: <{$from}>"; $headers[] = "subject: {$subject}"; $headers[] = "x-mailer: php/".phpversion(); mail($to, $subject, $message, $headers);
but time emails
delivered spam
.
any suggestion.
this have 2 reason in look:
some email service send mail spam when:
from
header not equaldomain
example domaintest.com
headersupport@google.com
.and server ip in black list in server.
Comments
Post a Comment