PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am new to this forum as well as PHP, so forgive me if this is a noob question. I used the search and tried everything I thought might be helpful but I was unsuccessful. Anyway I am just trying to send a simple email using the "mail()" fuction.
<?php
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Mail it
mail("matt@sks.com", "hello", "test" ,$headers);
?>
Also, do I need any other files to make the mail() function work.
mail() can require several things depending on your installation. It will want a proper SMTP setting on Windows machines. It may (often does) require a From in your headers. It may not even be able to send the mail because your host disallows its users to generate emails outside of their servers. The destination may reject the email due to "bad" headers, or it just doesn't like you, or more likely, your server.
We often recommend using phpMailer instead to help quickly fix these problems and give you added functionality.
Thanks, I am not quite sure what do do with this though. In the instructions it tells me to edit the php.ini file. I don't know where that file is. Also I am using http://www.yahoo.com as my domian provider. Maybe that has something to do with it.