5
Contributors
7
Replies
41
Views
3 Years
Discussion Span
Last Post by diafol
0

8e03ef12100d6d855f3b5bc377d8310d @ pritaeas & @rofus : its working. but i want to send whole php (it pulls some records from mysql) page to client email id. how to change subject and how to pass it?

Edited by Indians

0

Paste your code and show the data you want to send.

0

What'sthe problem in that, before constructing message body for mail fetch data from database append it in message and send mail.

0

@ diafol :

<?php
include("config.php");
if(isset($_GET["id"]))
{
    $id = mysql_real_escape_string($_GET["id"]);
    $query = mysql_query("SELECT * FROM ebvouchers WHERE VoucherID = $id");
    $row = mysql_fetch_object($query);
    echo mysql_error();
}
?>
<?php
      <tr>
        <td height=40 class=detailsfont>Name of Guest :</td>
        <td class=fetchfont>$row->GuestName</td>
        <td class=detailsfont>Phone Number of Guest : </td>
        <td class=fetchfont>$row->GuestPhone</td>
      </tr>
      <tr>
        <td height=40 class=detailsfont>Booking Date :</td>
        <td class=fetchfont>$row->BookingDate</td>
        <td class=detailsfont>Guest Email ID : </td>
        <td class=fetchfont>$row->GuestEmail</td>
      </tr>
?>

i want to fetch some datas from mysql and send an email to customer. here i can fetch the data perfectly based on a user id. how can i send those mysql datas through email... i tried it. but i received html fields only. i didn't get mysql records...

email.php

$body             = file_get_contents('sendemail.php');
0
<?php
      <tr>
        <td height=40 class=detailsfont>Name of Guest :</td>
        <td class=fetchfont>$row->GuestName</td>
        <td class=detailsfont>Phone Number of Guest : </td>
        <td class=fetchfont>$row->GuestPhone</td>
      </tr>
      <tr>
        <td height=40 class=detailsfont>Booking Date :</td>
        <td class=fetchfont>$row->BookingDate</td>
        <td class=detailsfont>Guest Email ID : </td>
        <td class=fetchfont>$row->GuestEmail</td>
      </tr>
?>

I'm surprised that you didn't get an error. There's no parsing going on...

<?php
$str = "<tr>
        <td height='40' class='detailsfont'>Name of Guest :</td>
        <td class='fetchfont'>{$row->GuestName}</td>
        <td class='detailsfont'>Phone Number of Guest : </td>
        <td class='fetchfont'>{$row->GuestPhone}</td>
      </tr>
      <tr>
        <td height='40' class='detailsfont'>Booking Date :</td>
        <td class='fetchfont'>{$row->BookingDate}</td>
        <td class='detailsfont'>Guest Email ID : </td>
        <td class='fetchfont'>{$row->GuestEmail}</td>
      </tr>";

echo $str;      
?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.