I looked into mail(), now im trying to figure out how to set it up. I was getting an error saying it could not connect to the mailserver 'localhost' so i first thought you couldn't send email because i was using my PC as the server. so i used ini_set() to set my SMTP to the mailserver which i use to send for my actual emails. This is what i have done:
<?php
ini_set("SMTP","mailserver");
ini_set("sendmail_from","Jermizzle@home.com");
$to="Jermizzle@home.com";
$subject="testing";
$body="I Love Lemonade";
$headers="From: Jermizzle@home.com/n";
mail($to,$subject,$body,"$headers");
echo "Mail is sent to $to";
?>
But i still get the error that it cannot connect to my mailserver, but its the correct mailserver address.
Failed to connect to mailserver at "mailserver" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Apache\Apache2\PHPFiles\mail.php on line 10
Does anyone know what im doing wrong. I have searched through the forum and found results but i do not understand it very well.
Thanks