Page 1 of 1

help with order form mail

Posted: Mon Jul 16, 2007 6:38 pm
by prasitc2005
Hi

I would rather avoid swiftmail as I have my own code to cope. I think I'm getting closer.


From this code,

Code: Select all

$mailto = "orders@ourdomain.com"; 
$subject = "Web Order"; 
  
$body  = "The following confirms the details of your order:\n"; 
$body .= "\n\n"; 
$body .= "Name: " . $Name . "\n"; 
$body .= "Email: " . $Email . "\n"; 
$body .= "Other Contact Info: " . $OtherInfo . "\n"; 
$body .= "\n\n"; 
$body .= "Class A Widgets: (" . $qtyA . " * 1.25) = " . $totalA . "\n"; 
$body .= "Class B Widgets: (" . $qtyB . " * 2.35) = " . $totalB . "\n"; 
$body .= "Class C Widgets: (" . $qtyC . " * 3.45) = " . $totalC . "\n"; 
$body .= "\n"; 
$body .= "TOTALS: " . $GrandTotal . "\n"; 
  
mail($mailto, $subject, $body); 
mail($Email, $subject, $body);
In this code, the mail got sent exactly the same copy to both email recipients.
The problem is that I want to send $mailto different subject and body from $Email. (eg, we want to send product code or credit card number to our own staff but we don't want a client to see our product code or his credit card number). Also I want the headers to be different so that when we get an e-mail from a client we can reply automaticly.

Please help!


Posted: Mon Jul 16, 2007 6:49 pm
by Zoxive
You aren't showing us where Email is coming from and you say you dont want to send each mail the same data?

Then why are you using the same exact variables?

Code: Select all

mail($mailto, $subject, $body);
mail($Email, $subject, $body);
The code is doing as exactly as you are telling it to.

Posted: Mon Jul 16, 2007 7:15 pm
by prasitc2005
The main problem is that I got blocked by gmail when sent the mail scripts to. Is there a way in if statement I can tell the mail to send spefific headers and message to specific email recipient? oh, $email is post from order form

a@test.com
headers:B Sales Deaprtment b@test.com
message: thanks you for buying b products

b@test.comhis
reply to: a@test.com
headers: Client a@test.com
message: here's his order id
his credit card number
his order id
his order items
our inter product code for the item is:

etc,