mail through javascript?
Posted: Wed Sep 07, 2005 1:25 pm
I am using the "phpwebsite" program and i need to do an automatic mail system.
I have tried the php function mail() but for some reason it does not work using this program.
For testing purposes I made a duplicate file containing the mailing section of the code and ran in on our test server, it worked perfectly...
If anyone has an idea as to why this is or how I can get around it I would appreciate your help.
However, becase of this I was thinking that there may be a way to email using javascript that I can just run on the page after thier order, but the only javascript functions I can find open up thier default email program and they would be allowed to edit the information. I need the email to happen without actual knowledge of it from the user.
The order is basically take from the email; so if they edit it, it will mess up the process.
The order can be checked for correctness, but we have to check every email... then things just get really time consuming and complicated.
Here is an example of the php code for reference
And an example of the javascript code for reference
Thank you for all of your help.
the phpwebsite program can be found at http://phpwebsite.appstate.edu/
I have tried the php function mail() but for some reason it does not work using this program.
For testing purposes I made a duplicate file containing the mailing section of the code and ran in on our test server, it worked perfectly...
If anyone has an idea as to why this is or how I can get around it I would appreciate your help.
However, becase of this I was thinking that there may be a way to email using javascript that I can just run on the page after thier order, but the only javascript functions I can find open up thier default email program and they would be allowed to edit the information. I need the email to happen without actual knowledge of it from the user.
The order is basically take from the email; so if they edit it, it will mess up the process.
The order can be checked for correctness, but we have to check every email... then things just get really time consuming and complicated.
Here is an example of the php code for reference
Code: Select all
if (mail($address, $subject, $body)) {
echo 'Your order has been accepted and you will be notified within 2-3 business days. Thank you for shopping at BD.com';
} else {
echo 'An unexpected error has occured. Please try again.';
}Code: Select all
address = 'orders@buys.com';
subject ='Orders';
body = "2 boxes of tissue";
window.location = "mailto:"+address+"?subject="+subject+"&body="+body;the phpwebsite program can be found at http://phpwebsite.appstate.edu/