Forums
This topic is locked
Email Update
12 Aug 2005 03:11:55 Jeff Dag posted:
I have office employees entering their computer problems into a web form. The form updates the database. What I would like to do is have an email sent to me letting me that someone has posted to the web site. I believe this can be done. Could someone point me in the right direction? Is there an extension, or server behavior that would accomplish this?Jeff
Replies
Replied 24 Aug 2005 17:31:56
24 Aug 2005 17:31:56 MACT Imaging replied:
you can insert the codes below after $Result1 = mysql_query($insertSQL, $mfe_inquiry) or die(mysql_error()); ( that is if you created your insert record from dreamweaver. )
This is the code:
/////////////////////////////////////////
$your_variables_here= $_REQUEST['your_fields_here'];
Note: just list your fields and variables here
/* recipients */
$recipient .= " ";
/* subject */
$subject = "Subject Here";
/* message */
$messagebody .= " Insert your message here";
Note: you may use html and css here
/* additional header pieces for errors, From cc's, bcc's, etc */
$headers .= "From: $name <$email>\n";
$headers .= "X-Sender: <$email>\n";
$headers .= "X-Mailer: PHP\n"; // mailer
$headers .= "X-Priority: 1\n"; // Urgent message!
$headers .= "Return-Path: <$email>\n"; // Return path for errors
/* Send HTML Emails */
$headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type
//send the eamil now
mail( "$recipient", "$subject","$messagebody", "$headers"
/////////////////////////////
Thats it.
This is the code:
/////////////////////////////////////////
$your_variables_here= $_REQUEST['your_fields_here'];
Note: just list your fields and variables here
/* recipients */
$recipient .= " ";
/* subject */
$subject = "Subject Here";
/* message */
$messagebody .= " Insert your message here";
Note: you may use html and css here
/* additional header pieces for errors, From cc's, bcc's, etc */
$headers .= "From: $name <$email>\n";
$headers .= "X-Sender: <$email>\n";
$headers .= "X-Mailer: PHP\n"; // mailer
$headers .= "X-Priority: 1\n"; // Urgent message!
$headers .= "Return-Path: <$email>\n"; // Return path for errors
/* Send HTML Emails */
$headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type
//send the eamil now
mail( "$recipient", "$subject","$messagebody", "$headers"
/////////////////////////////
Thats it.
Replied 24 Aug 2005 17:47:47
24 Aug 2005 17:47:47 Jeff Dag replied:
Thanks for your help!
Jeff
Jeff