Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: php and email

  1. #1
    Regular Coder
    Join Date
    Sep 2006
    Posts
    216
    Thanks
    9
    Thanked 0 Times in 0 Posts

    php and email

    PHP Code:
    mysql_connect("mysql10.powweb.com""""") or die(mysql_error());
    mysql_select_db("info") or die(mysql_error());

    $result2 mysql_query("SELECT team.TeamName, team.TeamID, League.LeagueID, League.Totalpts, SUM(selectedfootballerscore.TeamWeeklyScore), users.username FROM team, League, users, selectedfootballerscore WHERE (League.TeamID = team.TeamID) AND (selectedfootballerscore.TeamID = team.TeamID) AND (users.UserID = team.UserID) AND (League.LeagueID = '$LID') GROUP BY Totalpts");

    echo 
    "<table border=1><tr><td><font size=1 face='Verdana'>Team Name</font></td><td><font size=1 face='Verdana'>Manager</font></td><td><font size=1 face='Verdana'>Weekly Pts</font></td><td><font size=1 face='Verdana'>Total Pts</font></td><td></td></tr>";

    while (
    $row2 mysql_fetch_array($result2))
    {
    $messagept2 =  "<tr><td><font size=1 face='Verdana'>" $row2['TeamName'] . "</font></td><td><font size=1 face='Verdana'>" $row2['username'] . "</font></td><td><font size=1 face='Verdana'>" $row2['SUM(selectedfootballerscore.TeamWeeklyScore)'] . "</font></td><td><font size=1 face='Verdana'>" $row2['Totalpts'] . "</font></td></tr>";
    }
    echo 
    "</table>"
    I have the code above where data is being read out of a database and put into an html table. I want to ultimately send the data in the table as html in and email. How can this be done? Below is what I currently have. I can sned html using an extra header, but this wnt allow php to be sent.

    thanks

    PHP Code:
    $subject $_POST['subject'];
    $message "hello there, this is an email";
    $to "alextrebsy57@hotmail.com";
    $mailsend mail($to,$subject,$message); 

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Quote Originally Posted by alex57 View Post
    PHP Code:
    mysql_connect("mysql10.powweb.com""""") or die(mysql_error());
    mysql_select_db("info") or die(mysql_error());

    $result2 mysql_query("SELECT team.TeamName, team.TeamID, League.LeagueID, League.Totalpts, SUM(selectedfootballerscore.TeamWeeklyScore), users.username FROM team, League, users, selectedfootballerscore WHERE (League.TeamID = team.TeamID) AND (selectedfootballerscore.TeamID = team.TeamID) AND (users.UserID = team.UserID) AND (League.LeagueID = '$LID') GROUP BY Totalpts");

    $data "<table border=1><tr><td><font size=1 face='Verdana'>Team Name</font></td><td><font size=1 face='Verdana'>Manager</font></td><td><font size=1 face='Verdana'>Weekly Pts</font></td><td><font size=1 face='Verdana'>Total Pts</font></td><td></td></tr>";

    while (
    $row2 mysql_fetch_array($result2))
    {
    $data .=  "<tr><td><font size=1 face='Verdana'>" $row2['TeamName'] . "</font></td><td><font size=1 face='Verdana'>" $row2['username'] . "</font></td><td><font size=1 face='Verdana'>" $row2['SUM(selectedfootballerscore.TeamWeeklyScore)'] . "</font></td><td><font size=1 face='Verdana'>" $row2['Totalpts'] . "</font></td></tr>";
    }
    $data .= "</table>"
    PHP Code:
    $subject $_POST['subject'];
    $message "hello there, this is an email" $data;
    $to "alextrebsy57@hotmail.com";
    $mailsend mail($to,$subject,$message); 
    Something like that ^


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •