isaac_cm Posted May 30, 2007 Share Posted May 30, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/53595-tool-to-send-a-complete-page-content-by-mail/ Share on other sites More sharing options...
chigley Posted May 30, 2007 Share Posted May 30, 2007 <?php ob_start(); // The rest of your page here $output = ob_get_contents(); mail("you@domain.com", "Page Contents", $output); ?> You mean like that? Quote Link to comment https://forums.phpfreaks.com/topic/53595-tool-to-send-a-complete-page-content-by-mail/#findComment-264913 Share on other sites More sharing options...
obsidian Posted May 30, 2007 Share Posted May 30, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/53595-tool-to-send-a-complete-page-content-by-mail/#findComment-264977 Share on other sites More sharing options...
isaac_cm Posted May 30, 2007 Author Share Posted May 30, 2007 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"; Quote Link to comment https://forums.phpfreaks.com/topic/53595-tool-to-send-a-complete-page-content-by-mail/#findComment-265235 Share on other sites More sharing options...
isaac_cm Posted May 30, 2007 Author Share Posted May 30, 2007 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 Quote Link to comment https://forums.phpfreaks.com/topic/53595-tool-to-send-a-complete-page-content-by-mail/#findComment-265262 Share on other sites More sharing options...
isaac_cm Posted May 31, 2007 Author Share Posted May 31, 2007 oops I figure out how to output php variables if there is any other tools than phpmailer plz post thanks Quote Link to comment https://forums.phpfreaks.com/topic/53595-tool-to-send-a-complete-page-content-by-mail/#findComment-265545 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.