PDA

View Full Version : Request for tips on specifying recipients



tubaguy0
03-Jan-2007, 09:08 AM
Hello,

I would like to create a form that sends its output to a recipient based on one of the form fields. For example, I want to have a drop-down list as follows:

Label: What is this comment concerning?
Options:
The website
The calendar
Your account

And then send an e-mail to different e-mail addresses based on the user's choice.

Any thoughts?

Thank you!

russellr
03-Jan-2007, 10:10 PM
Hi,

Yes, you just need to generate the value of the "recipients" field dynamically.

One easy way is to just name your SELECT field "recipients" and put the different email addresses in the OPTIONS.

tubaguy0
04-Jan-2007, 01:07 AM
Thank you for the response.

What if you didn't want to show your e-mail addresses in a select field? I guess PHP variables would probably be the best bet at that point?

russellr
04-Jan-2007, 03:13 AM
Hi,

There's AT_MANGLE, and INI files for hiding email addresses.

tubaguy0
04-Jan-2007, 06:24 AM
Thank you for reminding me of the INI file. That's exactly what I needed.

For anyone else having a brain fart like I did today, I created the following code:

<select name="recipients">
<option value="schedule">The Schedule</option>
<option value="website">The Website</option>
<option value="boosters">Boosters</option>
<option value="other">Other</option>
</select>

and then pointed to an ini with the following:

[email_addresses]
schedule = "anotheremail@email.com"
website = "email@email.com"
boosters = "differentemail@email.com"
other = "yetanotheremail@email.com"

Thanks again, Russell. I can't believe you're still so diligent about answering forum posts 3 years after I first used the Tectite FM script (and here I am bugging you with newb questions again). A donation is on the way.

CyberOptics
06-Jan-2007, 02:05 AM
:p
Hi, I'm even stupider actually. How do you "point" to an ini file. please explain this really well, or I'll get lost in code!

CyberOptics
06-Jan-2007, 03:31 AM
hi I'm having REALLLL troubles with this. I'm not much of a programmer, so whatever I'm doing, I just can't pinpoint WHY I don't know what it is. I really need you to look over this code, and tell me what on earth I'm doing wrong. I don't know if it'smy HTML form, my ini, or the formmail.php setup but I repeatedly get emails in my inbox that say _no_valid_recipients

so if I attach these files, is there any way possible you could look them over, please?

Id be so thankful to get this working. And please talk to me in simple to understand language and leave no details out (but don't loose me either) because I just don't know sometimes what I might be missing that you know already. Here is the contact form file at:

http://mercatogelatocafe.com/formmail/contact.html

-Deborah

Thanks sooo much!

tubaguy0
06-Jan-2007, 05:15 AM
I'll try to help.

It looks like your ini and html are set up correctly, so the problem is apparently in your formmail script--most likely it's not finding your ini file as you suspected.

If you have set this option: $FORM_INI_FILE = "/path/to/formmail.ini";

then search for this: define("DB_SEE_INI",false); and set it to 'true'. Then save and go submit your form. If it shows a blank page, then the path to your .ini is wrong. If it shows your .ini, everything should be working. I have my ini in the same folder as the php script, so i can make it simple and just put 'formmail.ini' with no other path info.

The only other problem I can think of is that maybe you don't have the domains for all of the e-mail addresses you've got in your .ini configured to be allowed by the formmail script at the top of the script's configuration options.

I hope this helps.

CyberOptics
06-Jan-2007, 03:17 PM
Thanks for responding so quickly.

I didn't know that not having a few set up yet would affect it, and I know for fact that I didn't get the last two in.

Also I guess I'll also do that check. And my ini I was planning on having in the same folder too, because I won't give access to that directory anyway. That's safe, right?

Ok I'll try it and let you know how it went!

-Deborah

CyberOptics
06-Jan-2007, 03:57 PM
Hi, no it's still not working. I put the email addresses in, and they are all valid and working. I also did the ini file check. It said it was there for both the path I put in, and when I didn't put a path in. but when I remove that back to false, I still get an error occuring :

An error occurred while processing the form .

Our staff have been alerted to the error .
We apologize for any inconvenience this error may have caused.

and an email which says to me:


The following error occurred in FormMail :
no_valid_recipients
**********
Error=The form has an internal error - no valid recipients were specified.



but I wonder of I got this part correct:

$TARGET_EMAIL = array("^postmaster.@mercatogelato\.com$", "^wholesale.@mercatogelato\.com$", "^question.@mercatogelato\.com$", "^feedback.@mercatogelato\.com$", "^job_inquiry.@mercatogelato\.com$", "^webmaster.@cyberoptics\.ca$", "^reta.@mercatogelato\.com$","^barb.@mercatogelato\.com$", "^derek.@mercatogelato\.com$", "^deborahm.@mts\.net$", );


Because I figure that would also be important. You see I really don't understand why I need a dot before the @

the email addresses are:
wholesale@mercatogelato.com
question@mercatogelato.com
feedback@mercatogelato.com
job_inquiry@mercatogelato.com
webmaster@cyberoptics.ca
webmaster@mercatogelato.com
reta@mercatogelato.com
barb@mercatogelato.com
derek@mercatogelato.com
deborahm@mts.net

Have I entered the target email array in right? Or what? Because I want it to be able to go to any one of those email addresses...

or, do I have my ini set up right? For example instead of

[email_addresses]
question = "question@mercatogelato.com"
feedback = "feedback@mercatogelato.com"
job_inquiry = "job_inquiry@mercatogelato.com"
wholesale = "wholesale@mercatogelato.com"
webmaster = "webmaster@mercatogelato.com
webmaster1 = "webmaster@cyberoptics.ca"
other = "reta@mercatogelato.com"
deborahm = "deborahm@mts.net"


maybe because in my form it says name="recipients" I should have:

[recipients]
question = "question@mercatogelato.com"
feedback = "feedback@mercatogelato.com"
job_inquiry = "job_inquiry@mercatogelato.com"
wholesale = "wholesale@mercatogelato.com"
webmaster = "webmaster@mercatogelato.com
webmaster1 = "webmaster@cyberoptics.ca"
other = "reta@mercatogelato.com"
deborahm = "deborahm@mts.net"

CyberOptics
06-Jan-2007, 03:59 PM
I also just changed this:

<option value="deborahm@mts.net" >Webmaster</option>

to this:

<option value="webmaster1" >Webmaster</option>

in the form because I really don't want my email address picked up by hackers.

tubaguy0
06-Jan-2007, 11:13 PM
Hi Deborah,

In your formmail script, try removing all of those periods before the @ symbol.

so this:

$TARGET_EMAIL = array("^postmaster.@mercatogelato\.com$", "^wholesale.@mercatogelato\.com$", "^question.@mercatogelato\.com$", "^feedback.@mercatogelato\.com$", "^job_inquiry.@mercatogelato\.com$", "^webmaster.@cyberoptics\.ca$", "^reta.@mercatogelato\.com$","^barb.@mercatogelato\.com$", "^derek.@mercatogelato\.com$", "^deborahm.@mts\.net$", );

becomes this:

$TARGET_EMAIL = array("^postmaster@mercatogelato\.com$", "^wholesale@mercatogelato\.com$", "^question@mercatogelato\.com$", "^feedback@mercatogelato\.com$", "^job_inquiry@mercatogelato\.com$", "^webmaster@cyberoptics\.ca$", "^reta@mercatogelato\.com$","^barb@mercatogelato\.com$", "^derek@mercatogelato\.com$", "^deborahm@mts\.net$", );

I think the reason you got confused on that is because the last line of the configuration help says

//$TARGET_EMAIL = array(EMAIL_NAME."@yourhost\.com$",EMAIL_NAME."@otherhost\.com$");

but EMAIL_NAME. is a variable that allows you to use any e-mail address on a whole domain--so ideally your best configuration is probably this:

$TARGET_EMAIL = array(EMAIL_NAME."@mercatogelato\.com$",
"^deborahm@mts\.org$",
"^webmaster0@cyberoptics\.ca$");

CyberOptics
07-Jan-2007, 12:04 AM
neat. Ok I will try both!

CyberOptics
07-Jan-2007, 12:09 AM
FANTASTIC! You're a star! The greatest! Thank you soooooo much!

it worked!

-Deborah

tubaguy0
07-Jan-2007, 01:20 AM
Glad to hear it ;)

CyberOptics
07-Jan-2007, 04:24 PM
Since you helped me, I would be willing to give you a good deal on graphics anytime. If you need it. So let me know if you do. I have 14 years experience, and 2 diplomas in Advertising Art and New Media. I have quite a wealth of experience. From 3D computer animation, to print.

The offer is there.

-Deborah