Forum Moderators: coopster
Anyway, I have a client who is in need of a certain customization to it. I've googled and tried to find the answer, but I don't know how to put in the query string properly to get relevant answers. So, I'm hoping someone here can help me.
Right now, I have the form set up so when the user fills out the form and clicks "submit", he is redirected to a "Thank you" page, and the information he has submitted is sent to the client.
What I need *now* is for the above to happen, but the reason for the form is so that the user can request a file. The client wants to be notified when someone requests the file (and as stated above, he will be), but he wants the file e-mailed to the user automatically.
So, I need to find a way so that when the user submits the form, not only does the usual happen (stated above - info from the form sent to the client), but a standrad e-mail is sent *back* to the user with the client's file attached, all automatically.
I'm sure there's a way to do this, but I just can't figure it out - I'd appreciate any help I could get. My PHP code is below, if that would help (I've left out the required fields stuff and cookies to make it easier to read):
<?
if($action!="sendmail"[smilestopper]){
include ("paper.html"[smilestopper]);
exit;
}
if ($action == "sendmail"[smilestopper]) {
$message = nl2br("Name: $title $firstname $lastname
Company: $company
Phone: $phone
e-Mail address: $email"[smilestopper]);
$message = stripSlashes($message);
$mailheader = "From: $name <$email>\nContent-Type: text/html";
mail("Client Company Name <email@thecompany.com>","$subject","$message","$mailheader"[smilestopper]);
}
{
include("thanks.html"[smilestopper]);
exit;
}
?>
I'd appreciate anyone's help on this...thanks!
Yes, serving up a link as an option has come up. The client is considering that possibility and (fingers crossed) he goes for that - I *can* do that - that hasn't been an issue. but if he decides to have the e-mail attchment sent, then I still need to figure out how to do so.
I *did* figure out how to send 2 different e-mails from one form to 2 different recipients - that was pretty easy. I just still need to igure out how to send one of those with an attached file. (And I'm willing to mess with headers to do so - I just need a pointed in the right direction on how to do it).
If you all have any more suggestions, I'd appreciate it - in the meantime, I'll go check out that form...