Guest 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] Link to comment https://forums.phpfreaks.com/topic/192428-php-code-question/ 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 Link to comment https://forums.phpfreaks.com/topic/192428-php-code-question/#findComment-1013920 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 = "[email protected]"; //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 https://forums.phpfreaks.com/topic/192428-php-code-question/#findComment-1013944 Share on other sites More sharing options...
Guest Posted February 17, 2010 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 Link to comment https://forums.phpfreaks.com/topic/192428-php-code-question/#findComment-1013946 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', '[email protected]'); Link to comment https://forums.phpfreaks.com/topic/192428-php-code-question/#findComment-1013949 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.