I have a free 000webhost account so I can't use php mailer or something like that. Normally whenever I use the php mail function it goes to my spam but now the emails aren't even appearing anywhere (I'm presuming that 000webhost's mail server is temporarily down). I want to be able to have it so the emails don't go to spam. Thanks for any help in advance.
Make sure you have the correct header information, but the receiving server picks where to put the email. example: gmail.com just believes your url / server / email is spam.
There can be a lot of reasons for that, make sure you do all the proper webmaster work on https://www.google.com/webmasters/tools/home?hl=en
This will help with gmail at least.
You can only do, so much even stackoverflow emails goto my spam folder and stack is huge.
Just make sure you tell people who submit forms to check their spam folders.
<?php
$to = 'johndoe@gmail.com';
$from = "emailaccount_youhave_setupon_server@yoruserver.com";
$subject = 'Website: Account Activation';
$message = '<!DOCTYPE html><html>
<head><meta charset="UTF-8"><title>Website: Message</title></head>
<body style="margin:0px;">
<div style="padding:10px;">
Website: Account Activation
</div>
<div style="padding:24px; font-size:17px;">
Hello '.$u.',<br><br>
Click the link below to activate your account:<br><br>
Click here to activate your account
</div>
</body></html>';
$headers = "From: ".$from."\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
if(mail($to, $subject, $message, $headers)){echo 'email sent';}
?>