Jump to content

Recommended Posts

Hello,

I know how to use mail() function and it work fine with me but I am wondering if there is a tool or a way to just pass the the desired page to send to mail address with all its content (graphics+HTML+PHP) , any idea ?

 

Notice: I can only use mail() function no smtp available

 

thanks

A few things to keep in mind: first, any images on the page will have to be attached and handled as Embedded images within the content of your email. With this in mind, IMHO, there would be a 3 step process to get what you're after:

 

1. Screen scrape the desired page to get your markup.

2. Parse and download all images used within the markup.

3. Substitute the img tags with embedded images, attaching the matching downloaded images to the message.

 

You would have to write up a fairly complex algorithm to come up with a working model (especially considering that many images may be served up via CSS as well).

 

If you use a tool for your actual mailing such as PHPMailer, step 3 above would be very easy. It's step two that would be the most difficult, IMHO. Just making sure that you had all the images from the page could be quite tricky.

 

Hope this gives some direction.

sorry but I dont understand you completely if there a good example please tell me about it

 

I also need to output php script from some variables or objects

 

I use the following header , it work but only with HTML

//============================================

$headers  = 'MIME-Version: 1.0' . "\r\n";

$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

$headers .= "From:".$senderRealName."<".$senderEmailAddress.">\r\n";

$headers .= "Reply-To:".$senderEmailAddress."\r\n";

$headers .= "Importance: Normal\r\n";

$headers .= "Subject:".$emailSubject."\r\n";

$headers .= "X-Priority: 3\r\n";

$headers .= "X-Sender:".$senderEmailAddress."\r\n";

$headers .= "X-MSMail-Priority: Normal\r\n";

$headers .= "X-Mailer: PHP/".phpversion()."\r\n";

$headers .= "X-Server: ".$_SERVER['SERVER_NAME']."\r\n";

$headers .= "X-Host: ".$_SERVER['HTTP_HOST']."\r\n";

I need to send shopping cart content through mail my car look like this:

 

<?php

if (!$my_ecart->IsEmpty())    {

?>

                          <table  width="85%" cellpadding="5" cellspacing="0" class="S1B_Layout">

                            <tr>

                              <td colspan="7" class="S1B_CartTitle">Shopping Basket </td>

                              </tr>

                            <tr valign="top" class="S1B_ColumnHeaderRow">

                              <td width="8%" align="center" class="S1B_ColumnHeader">Code</td>

                                <td width="37%" align="left" class="S1B_ColumnHeader">Name</td>

                                <td width="6%" align="center" class="S1B_ColumnHeader">Size</td>

                                <td width="16%" align="center" class="S1B_ColumnHeader">Colour</td>

                                <td width="7%" align="center" class="S1B_ColumnHeader">QTY</td>

                                <td width="11%" align="center" class="S1B_ColumnHeader">Price</td>

                                <td width="15%" align="center" class="S1B_ColumnHeader">Total</td>

                              </tr>

                            <?php

  $A_ItemRowStyle_1 = array();

    $A_ItemRowStyle_1[0] = "S3B_RowOdd";

  $A_ItemRowStyle_1[1] = "S3B_RowEven";

  $A_ItemRowStyle_1=new A_eCartDisplayCSSLooper($A_ItemRowStyle_1);

  ?>

                            <?php

while (!$my_ecart->EOF())      {

?>

                              <tr class="<?php echo $A_ItemRowStyle_1->ReturnNextIndex(); ?>">

                                <td valign="top" align="center" class="S1B_FirstColumnItem"><?php echo $my_ecart->DisplayInfo("prodsku"); ?></td>

                                  <td valign="top" align="left" class="S1B_Name"><?php echo $my_ecart->DisplayInfo("Name"); ?></td>

                                  <td valign="top" align="center" class="S1B_ColumnItem"><?php echo $my_ecart->DisplayInfo("opt1size"); ?></td>

                                  <td valign="top" align="center" class="S1B_ColumnItem"><?php echo $my_ecart->DisplayInfo("opt2color"); ?></td>

                                  <td valign="top" align="center" class="S1B_ColumnItem"><?php echo $my_ecart->DisplayInfo("Quantity"); ?></td>

                                  <td valign="top" align="center" class="S1B_ColumnItem"><?php echo A_eCart_Show($my_ecart, $my_ecart->DisplayInfo("Price")); ?></td>

                                  <td valign="top" align="center" class="S1B_ColumnItem"><?php echo A_eCart_Show($my_ecart, $my_ecart->DisplayInfo("TotalPrice")); ?></td>

                                </tr>

                              <?php

  $my_ecart->MoveNext();

}

$my_ecart->MoveFirst();

?>

                            <tr>

                              <td colspan="7" class="S1B_OrderTitle">Order Summary</td>

                              </tr>

                            <tr valign="top">

                              <td colspan="6" class="S1B_Subtotal">Sub-Total</td>

                                <td class="S1B_SubtotalPrice"><?php echo A_eCart_Show($my_ecart, $my_ecart->TotalColumn("TotalPrice")); ?></td>

                              </tr>

                            <tr>

                              <td colspan="6" class="S1B_OrderHeader">Postage & Packing</td>

                                <td align="right" class="S1B_OrderLineItem"><?php echo A_eCart_Show($my_ecart, $my_ecart->GetCharges()); ?></td>

                              </tr>

                            <tr valign="bottom">

                              <td colspan="6" class="S1B_OrderTotal">Total</td>

                                <td align="right" class="S1B_OrderTotal"><?php echo A_eCart_Show($my_ecart, $my_ecart->GrandTotal()); ?></td>

                              </tr>

                            </table>

                            <?php

//A eCart Show If Middle

}

else    {

?>

  <table class="S3B_Layout">

    <tr><td class="S3B_CartTitle">The cart is empty</td></tr>

  </table>

                          <?php

//A eCart Show If End

}

?>

 

//========================================

there is also CSS used here so I think I have to attach the CSS file using only mail() func, please advice

thanks

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.