wantabe2 Posted February 17, 2010 Share Posted February 17, 2010 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] Quote Link to comment Share on other sites More sharing options...
bbaker Posted February 17, 2010 Share Posted February 17, 2010 http://us.php.net/manual/en/function.mail.php Quote Link to comment Share on other sites More sharing options...
LeadingWebDev Posted February 17, 2010 Share Posted February 17, 2010 $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. Quote Link to comment Share on other sites More sharing options...
wantabe2 Posted February 17, 2010 Author Share Posted February 17, 2010 I'm still lost...I'm new to php programming...I've edited my php.ini file to reference my smtp server. In the php.ini file it says: SMTP = mysmtpserver smtp_port = 25 Quote Link to comment Share on other sites More sharing options...
LeadingWebDev Posted February 17, 2010 Share Posted February 17, 2010 use it inside mailing script, this code will overwrite php.ini smpt setting. ini_set('sendmail_from', 'me@domain.com'); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.