Page 1 of 1

Simple question about email includes in form processor

Posted: Sun Jan 20, 2008 11:46 am
by JetJagger
I need to use an email include in a CGI-BIN form processor. Here's the scenario....

A. Email address is located in ' ../includes/email.php '
(the php file only has a single email address in it)


B. The CGI-BIN form processor is typical. Looks like this:

Code: Select all

mail("jetjagger@gmail.com", $subject, $message, $from);

C. I need to replace the above email address syntax with whatever script that will pull the email address out of ' ../includes/email.php '


D. In other words, ' jetjagger@gmail.com ' (or whatever email address resides there) need to be replaced by a script that functions similar to a php include script. In short, I don't want the physical email address in the line of code as shown in B.

*NO, my email addresses are not in a database.

Any suggestions?

Thanks,

Jet

Re: Simple question about email includes in form processor

Posted: Sun Jan 20, 2008 12:28 pm
by Jonah Bron

Code: Select all

<?php
mail(file_get_contents('../includes/email.php'), 'Message Subject', 'Message', $from);
?>

Re: Simple question about email includes in form processor

Posted: Sun Jan 20, 2008 1:36 pm
by JetJagger
PHPyoungster wrote:

Code: Select all

<?php
mail(file_get_contents('../includes/email.php'), 'Message Subject', 'Message', $from);
?>
Thanks, that worked (used a .txt file in place of a php file though).