sending mail, not working
Posted: Mon Mar 24, 2003 6:36 pm
This worked before for me, but since i upgraded my version of php it doesn't at all.
Line 25 is the mail() line, it can't be the code that's wrong i had the exact same version of code working on my previous php install. My current version is 4.1.1, my OS is Windows XP Pro. Did i miss a patch or some sort of setting adjustment news headline?
Thanks.
sendmail.php wrote: Warning: Failed to Connect in c:\...\...\...\sendmail.php on line 25
Code: Select all
<?php
// set up a message
$subject = "hello!";
$msg = "hi
\n
how's it going?";
$headers = "From: "Oromian" <oromian@hotmail.com>";
// connect to the database and collect addresses
require ("dbinfo.php");
$sql = "select email from emails";
$res = @mysql_query($sql) or die("Couldn't get addresses.");
// loop through the result set and send mail
while ($email_row = @mysql_fetch_array($res)) {
// get the recipient address
$to = $email_row['email'];
//send the mail
mail("$to", "$subject", "$msg", "$headers");
//print a confirmation to the screen
echo "mail sent to $to <br>";
}
?>Thanks.