Jump to content

Send Mail Help


bombdigiti

Recommended Posts

hey all

  i'm trying to get this script to send to an email address but it won't. it prints the message at the end and everything but still will not send any information to the email address. any thoughts or ideas would be awesome, thanks. I subbed out my email in it btw, so that isn't it...

 

-------------------------------------------------------------------------------------------------------------------------------------------------

<?php

//connecting to the database

require('connect.php');

?>

 

<?php

session_start();

$today = getDate();

$datestring = $today['year']."-".$today['mon']."-".$today['mday'];

$totalitems = $_SESSION['purchases'];

$totalnum = intval($totalitems);

$user = $_SESSION['id'];

$querystring = "SELECT customer_lname,customer_fname,customer_email FROM tbl_customer WHERE customer_id = '".$user."'";

$myquery = mysql_query($querystring);

$row = mysql_fetch_array($myquery);

$custinfo = $row['customer_fname'].",".$row['customer_lname'].",".$row['customer_email']."\n\n";

 

$to = "myemail@hotmail.com";

$subject = "Purchases Reciept";

$msg = "Order recieved from ".$row['customer_fname']." ".$row['customer_lname'];

 

for($i=1;$i<=$totalnum;$i++) {

$thisitem = "item".$i;

$thisprice = "price".$i;

$thistype = "type".$i;

$addstring = "INSERT INTO tbl_purchases(purchases_id,customer_id,product_id,product_price,date_purchased,purchases_description) VALUES(NULL,'".$_SESSION['id']."','".$_SESSION[$thisitem]."','".$_SESSION[$thisprice]."','".$datestring."','".$_SESSION[$thistype]."')";

$additem = mysql_query($addstring);

$msg .= "\n\n item: ".$_SESSION[$thisitem]." price: ".$_SESSION[$thisprice]." type: ".$_SESSION[$thistype]."\n";

}

 

$fullmsg = $custinfo.$msg;

mail($to,$subject,$fullmsg);

print "Thank you for your order";

print $fullmsg;

?>

 

-------------------------------------------------------------------------------------------------------------------------------------------------

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.