homepage Welcome to WebmasterWorld Guest from 54.197.211.197
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
PHP mass email problem
cgallent

10+ Year Member



 
Msg#: 1682 posted 9:08 pm on Sep 8, 2003 (gmt 0)

Here's the code:
<php?
$colname_rs_list = "1";
if (isset($HTTP_GET_VARS['id'])) {
$colname_rs_list = (get_magic_quotes_gpc())? $HTTP_GET_VARS['id'] : addslashes($HTTP_GET_VARS['id']);
}
mysql_select_db($database_calendar, $calendar);
$query_rs_list = sprintf("SELECT emailaddress, calendarmssgs.title FROM calendareventreg, calendarmssgs WHERE event = %s AND calendarmssgs.id = calendareventreg.event", $colname_rs_list);
$rs_list = mysql_query($query_rs_list, $calendar) or die(mysql_error());
$row_rs_list = mysql_fetch_assoc($rs_list);
$totalRows_rs_list = mysql_num_rows($rs_list);

$subject = $row_rs_list["calendarmssgs.title"];
$message = "This message is to remind you that you are registered for the class at Mere Bulles on 10/1/03 at 5:30pm.";
do {
$to = $row_rs_list['emailaddress'];
mail($to, $subject, $message, "From: some person <info@site.com>");
} while ($row_rs_list = mysql_fetch_assoc($rs_list));

mysql_free_result($rs_list);

header ( "Location: [site.com...]
?>

id is passed from a form to process a list of attendees to an event. When the code is run I get an email error in the inbox where it says that no recipient email address was added. The script runs perfectly if it is output in a table. Any ideas?

[edited by: jatar_k at 9:53 pm (utc) on Sep. 8, 2003]
[edit reason] generalized emails and url [/edit]

 

daisho

10+ Year Member



 
Msg#: 1682 posted 1:21 pm on Sep 9, 2003 (gmt 0)


mail($to, $subject, $message, "From: some person <info@site.com>");

Not sure if this will make a difference for you but a properly formated From header should look like:

mail($to, $subject, $message, "From: \"some person\" <info@site.com>\n");

The persons name *should* be in quotes. And each header *must* end with a new line.

daisho

jatar_k

WebmasterWorld Administrator jatar_k us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 1682 posted 3:50 pm on Sep 9, 2003 (gmt 0)

another thing to try would be to echo $to and comment out the mail call to make sure that the recipient is actually being set here.

$to = $row_rs_list['emailaddress'];

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved