Simple question about email includes in form processor

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JetJagger
Forum Newbie
Posts: 6
Joined: Sun Jan 20, 2008 11:35 am

Simple question about email includes in form processor

Post 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
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: Simple question about email includes in form processor

Post by Jonah Bron »

Code: Select all

<?php
mail(file_get_contents('../includes/email.php'), 'Message Subject', 'Message', $from);
?>
JetJagger
Forum Newbie
Posts: 6
Joined: Sun Jan 20, 2008 11:35 am

Re: Simple question about email includes in form processor

Post 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).
Post Reply