Hi,
Still fairly new to PHP, so a lot of my (working) scripts, is a wild combination of googling, this forum, and i guess, luck.
Im working on, for me anyways, quite a big project, where one of the ‘elements’ is people being able to register, and signup for a newsletter.
I’ve got it working, i’m just curious to find out if the way im doing it, is a proper way, and as i’m currently testing with only 3 receipients, if it will work when more/plenty/alot of mails have to be send
i get the email adresses from a mysql database and have mail() function in a while loop, reading out that database:
[code=php]
while($row = mysql_fetch_assoc($result)){;
$mail = $row[’email’];
$onderwerp = $_GET[‘onderwerp’];
$content = $_GET[‘content’];
$content = stripslashes($content);
$to = $mail;
$subject = $onderwerp;
$message = ”
<html>
<head>
</head>
<body>
$content
</body>
</html>
“;
$headers = “MIME-Version: 1.0” . “rn”;
$headers .= “Content-type:text/html;charset=iso-8859-1” . “rn”;
$headers .= ‘From: <[email protected]>’ . “rn”;
mail($to,$subject,$message,$headers);
}
As said, this works, but im far from sure this is thé way of doing it??
Also, is it possible to check if the mail function worked? I’m not desperately after knowing if te receipient received the e-mail, but knowing if the mail() function did it’s work would be nice, so i can echo a message, informing the ‘sender’ if it went ok or not.
Any input is highly appreciated!
Thanks,
peace