Jump to content

How dow add data to table


nthrusse

Recommended Posts

First I need to create a table or add to an existing table - the table needs to contain a date -msg last sent date

 

Then run the following email script for each record if the value of the msg last sent date is greater than >30 days???

after the script is run, it updates the records it emailed to todays date...

 

<?php

include "vsadmin/db_conn_open.php";

$allprods=mysql_query("select pID, pName, pPrice, pDropship, dsID, dsName, dsEmail from products, dropshipper where pDropship = dsID");

while ($yarr=mysql_fetch_assoc($allprods)){

$aname=$yarr["pID"];

$bname=$yarr["pName"];

$cname=$yarr["dsName"];

$dname=$yarr["dsEmail"];

$ename=$yarr["pPrice"];

 

$to = $dname;

$subject = ("Your Ebook: " . $bname);

$body = ("Hello " . $cname .",\n\nYou have the following ebook listed for sale on www.insertwebsite.com (". $bname .").

\nYour Ebook (product) is currently listed at the retail price of $" . $ename .

"\n\nThe following link is provided to you as a marketing tool for your current or future email campaigns.  This link is a direct link to your ebook on the Enlightened Ebooks site.

\n www.www.insertwebsite.com/proddetail.php?prod=". $aname .

"\n\nOnline sales is a safe secure way to increase your ebook sales.  Simply provide the link in all your correspondences and you sales will increase.  You are your own best promoter.");

$headers = "From: neil@me.com\r\n" .

  "X-Mailer: php";

if (mail($to, $subject, $body, $headers)) {

  echo("<p><b>Message sent to.</b></P>". $cname . "  for the following ebook  " . $bname );

  } else {

  echo("<p>Message delivery failed...</p>");

  }}

?>

Link to comment
Share on other sites

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.