Jump to content

PHP Code Question


wantabe2

Recommended Posts

I've attached my sample code. This code works just like I need it to. The information chosed or typed in gets sent to my mysql database. On line 54 of this code you will see I have drop down box the users can choose a supervisor. I have supervisor1, supervisor2, and supervisor3. At the end of the code I have a submit button & when it is clicked it send the data chosen/entered into my mysql database perfect.

 

My question is, is there a way for me to enter some type of code in there somewhere so when the user clicks the submit button it will also send an email to supervisor1, supervisor2, or supervisor3 (which ever one is chosen) with all the information that is enetered in the mysql database?

 

I do have an smtp server on my LAN I can use. Thanks for any help you can provide.

 

[attachment deleted by admin]

Link to comment
Share on other sites

$Name = "$results[first_name] $results[last_name]"; //sender's name
$email = "$results[email]"; //sender's e-mail address
$recipient = "mail@mail.com"; //recipient(Supervisor's mail)
$mail_body = "$txt";
$subject = "$subj";
$header = "From: ". $Name . " <" . $email . ">\r\n";
mail($recipient, $subject, $mail_body, $header); 

 

mail() may work not correctly if your mail box located at same host. 1 time i had this trouble.

 

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.