This is my message.php file
Code: Select all
<?php
<html>
<head>
</head>
<body>
<form action="send.php">
Subject: <input type=text name=subject"><br>
Message: <textarea name=message></textarea><br>
<input type=submit name=submit value=submit>
</form>
</body>
</html>
?>Code: Select all
<?php
<?
//Program that takes data from the page
//message.php and sends it
//Connect to database
mysql_connect("localhost","root","");
//Select the database we want to use
mysql_select_db("library");
//Get the contents of the column Email from
//mailinglist table and put in an array.
$sql = "SELECT * FROM mailinglist";
$result = mysql_query($sql);
//data from the message.php page
$subject = $_POST['subject'];
$message = $_POST['message'];
//Send message loop
While ($row = mysql_fetch_array($result)) {
$email = $row['Email'];
//Take notice that we've included $subject and $message below
mail("$email","$subject","$message","From: crazy@raspit.com");
echo("Newsletter sent!<br>");
}
//Close the database connection
mysql_close();
?>
?>Code: Select all
Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in c:\program files\apache group\apache\htdocs\send.php on line 24
Newsletter sent!Code: Select all
; overload(replace) single byte functions by mbstring functions.
; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(),
; etc. Possible values are 0,1,2,4 or combination of them.
; For example, 7 for overload everything.
; 0: No overload
; 1: Overload mail() function
; 2: Overload str*() functions
; 4: Overload ereg*() functions
;mbstring.func_overload = 0By the way my mail server ip is
Code: Select all
202.141.190.5 (mail.raspit.com)
And the account from which I would like to send email is : crazy@raspit.com