Jump to content
Sign in to follow this  
webgyrl

Ultimate Form Mail

Recommended Posts

Just working on a Contact page and I am implimenting Jack's Ultimate Form Mail Script.

 

Does anyone know how i would go about making a drop down menu with several contact name options and having the user select only ONE of these people to send the email to from the site?

 

I used the contact4.php template but it has check boxes... upon further reading of the docs it seems that the email is sent to all of those listed in the recipint array of the mailit.php code.

 

I've got this in my drop down code so far, but not sure if I need to add any other variable etc

<select name="send_to">

                                        <option selected>select recipient</option>

                                        <option value="*****@zikkipublishing.com">Jeremy

                                        Rwakaara</option>

                                        <option value="****@zikkipublishing.com">General

                                        Info</option>

                                        <option value="*********@zikkipublishing.com">Licensing

                                        Inquiry</option>

                                        <option value="*********@zikkipublishing.com">Webmaster</option>

                                      </select>

Anyone know how I can have the email sent to only the chosen recipient in that drop down list? What modifications would I need to make to this line of mailit.php code:
$set['recipient'] = array('*****@zikkipublishing.com', '****@zikkipublishing.com', '**********@zikkipublishing.com', '*******@zikkipublishing.com');

 

Thanks for any help you can give.

 

Nat

 

PS... the page I am working on is at this link:

http://www.zikkipublishing.com/contact_wk.php

Share this post


Link to post
Share on other sites

Ok I just tested the form and got this error message:

 

Message could not be sent. Mailer Error: Language string failed to load: recipients_failedwambuigirl@adelphi.netMessage could not be sent. Mailer Error: Language string failed to load: recipients_failed

 

Where did I go wrong?

 

_______________

Edit: I thought perhaps the error was that 2 of the email addresses in the recipient array in the mailit.php code were in the wrong order. I put them in the right order as they correspond to the 'send_to' field in the Contact form... still got the same error.

Share this post


Link to post
Share on other sites

Here is my mailit.php code:

<?php

/*=============

#Ultimate Form Mail Script

#Version 2.5.1 Beta

#

# Copyright 2003 Jack Born © All rights reserved.

# Created 06/29/03 Last Modified 2/1/04

# Jack Born http://www.surefirewebdesign.com

#

# This cannot and will not be inforced but I would appreciate a link back

# to my site:

#

# http://www.surefirewebdesign.com/

#

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL

# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR

# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,

# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR

# OTHER DEALINGS IN THE SOFTWARE.

#

==============*/

error_reporting(0);

 

$license = "Put the license here";

 

require_once "class.UFMail.php";

require_once "antispoof/protect.php";

 

/*********************************/

/*This is the only variable you need*/

/*To change*/

/*********************************/

$set['recipient'] = array('*****@zikkipublishing.com', '****@zikkipublishing.com', '*********@zikkipublishing.com', '**********@zikkipublishing.com');

 

$set['website'] = 'www.zikkipublishing.com';/*Should be www.youractualsite.com */

$set['redirect'] = 'thanks.php';/*http://www.yoursite.com/somepage.htm  This is the page visitors see after successfully sending you information.  Strongly recommended*/

$set['banlist'] = array('*@somedomain.com', 'user@domain.com', 'etc@domains.com');

$set['headerfile'] = 'header_file.php';/*A php file if you want custom error pages */

$set['footerfile'] = 'footer_file.php';/*A php file if you want custom error pages */

$set['dropdown_recipient'] = '1'; /*If you have a dropdown list for potential recipients, put 1.  Most will leave to zero... off */

$set['dropdown_name'] = 'send_to'; /*The name of your field for the drop down list... don't use 'recipient' */

$set['dropdown_list'] = $set['recipient'];/*This keeps your email addresses private */

 

 

$set['webmaster_subject'] = 'Contact from your website %s';

$set['webmaster_body_intro'] = "Here is the information sent to you on %s:\n\n";

$set['webmaster_confirm'] = '<br>Sent message to %s';

 

/*********************************/

/*Auto-reply sent to visitor*/

/*********************************/

$set['autoresponder'] = '1';

$set['auto_from_name'] = "zikki publishing Contact Form"; /*Can be whatever you want... visitor sees this in the To: portion of auto reply email*/

$set['auto_from'] = "info@zikkipublishing"; /*Very important if you want them to be able to reply to your email */

$set['auto_reply_name'] = "";/*Most leave blank.  Used if you want a different name when your visitor replies to your autoresponder email */

$set['auto_reply'] = ""; /*Most leave blank.  Used if you want a different email addy when your visitor replies to your autoresponder email */

$set['receipt'] = '0'; /*On =1 ... sends copy of posted info to your visitor */

$set['receipt_intro'] = "Here is what you sent us:\n\n";

$set['auto_reply_subject'] = 'Thank you for visiting %s.';

$set['auto_reply_body'] = "We received your information and will be getting back to you shortly.\n\n";

$set['auto_reply_signaturesignature'] = "\n\nSincerely, \n\n" . $set['website'];

$set['auto_reply_confirm'] = 'Sent auto-reply to %s';

 

 

/*********************************/

/*Default field checking functions*/

/*Delete, modify, or add lines if you know what you're doing.*/

/*Playing with these formulas is not for the faint of heart... be careful*/

/*********************************/

 

$set['field_check_eregi'] = array(

'email' => '^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]{2,})+$'

);

 

$set['field_check_ereg'] = array(

'phone' => '(^(.*)[0-9]{3})(.*)([0-9]{3})(.*)([0-9]{4}$)',

'phone_no' => '(^(.*)[0-9]{3})(.*)([0-9]{3})(.*)([0-9]{4}$)'

);

 

/*********************************/

/*File Upload*/

/*********************************/

$set['file_upload'] = '0';

$set['file_max_size'] = '500';/*Max file size in KB*/

$set['banned_ext'] = array('php', 'phtml', 'cgi', 'pl', 'asp', 'jsp', 'c', 'cfm', 'shtml', 'exe', 'bat', 'com');

$set['file_max_size_total'] = '500';/*If more than one file, this is the maximum total upload size for all attachments combined*/

 

/*********************************/

/*Error language*/

/*********************************/

$set['no_email_field'] = '<h2>You need to have a form field named <b>email</b></h2><p>Change your html code in your form so that the email field is named "email"</p>';

$set['error_title'] = '<h2>No email sent</h2><p>%s</p>';

$set['total_file_size_error'] = 'You attempted to send us %d Kb or more in attachments and we only allow %d for security reasons.<br>';

$set['file_size_error'] = "You attempted to send us a %d Kb attachment and we only allow %d for security reasons.<br>";

$set['file_type_error'] = 'You attempted to send us a %s document and it is banned for security reasons.<br>';

$set['required_error'] = '%s is required... but not found<br>';

$set['required_no_error'] = '%s is required... AND found<br>';

$set['referer_error'] = 'Posted info from %s but should be from %s<br>';

$set['invalid_error'] = 'Your %s is invalid<br>';

$set['recipient_error'] = 'The recipient you chose %s was not found<br>';

$set['drop_down_error'] = 'Your drop down form field is missing or does not match<br>';

$set['drop_down_not_in_list_error'] = 'Your drop down selection was not valid<br>';

$set['email_banned'] = 'Your email address is not allowed<br>';

$set['wrong_hash'] = 'You either took longer than %s minutes to complete the form or you are coming from an unauthorized domain.';

 

/*********************************/

/*SMTP Variables*/

/*********************************/

$set['html'] = TRUE; /*HTML emails*/

$set['email_type'] = '1';/*1=smtp, 2=mail(), 3=qmail, 4=sendmail*/

$set['host'] = 'localhost';/*Most don't need to change */

$set['authorization'] = 'false';/*Most don't need to change.  set to 'true' if you need to change */

$set['username'] = '';/*Most don't need to change */

$set['password'] = '';/*Most don't need to change */

$set['html_template'] = "template/email.tpl.php";

 

/*********************************/

/*Anti Spoof*/

/*********************************/

$set['anti_spoof']  = '0';

$set['hash_name'] = 'as_hash';

$set['interval'] = $as->interval;

$set['time_frame']  = $as->time_frame;

 

/*********************************/

/*Testing code language*/

/*********************************/

$set['testing'] = '0'; /*On = 1 ... great for debugging */

$set['testing_title'] = '<h1>Test Results:</h1>';

$set['testing_error'] = '<p>No email would be sent to %s</p>';

$set['timestamp'] = '<p>The form was submitted %s</p>';

 

/*********************************/

/*Miscellaneous*/

/*********************************/

$set['date_format'] = 'l F j, Y'; /*date format for information*/

$set['post_info'] = "%s: %s\n";

$set['ignore_these'] = array('Submit','submit','required', 'Required', $set['hash_name']);

$set['referer_check'] = '0';//Referer check is now deactivated

 

/*=============

Leave these next several lines alone

==============*/

$obj = new UFMail;

$obj->initialize($set); //Gets things going

$obj->check_vars(); //Runs the error checking

$obj->branch(); //Sends the emails

$obj->thanks_page(); /* Redirects if the corresponding variable is set */

?>

Share this post


Link to post
Share on other sites

Here is my Form Code:

<form action="form/mailit.php" method="post" enctype="multipart/form-data" name="form1">

                                <div align="left">Fields in <b>BOLD</b> are reqired<br>

                                </div>

                                <table width="100%" border="0" cellspacing="3" cellpadding="0">

                                  <tr>

                                    <td width="45%">

                                      <div align="right"><font size="2"><b>Company</b></font></div>

                                    </td>

                                    <td width="15"> </td>

                                    <td><font size="2">

                                      <input name="company" type="text" id="name" size="25" maxlength="80">

                                      </font></td>

                                  </tr>

                                  <tr>

                                    <td width="45%">

                                      <div align="right"> <font size="2"><strong><b>First

                                        & Last Name</b></strong></font></div>

                                    </td>

                                    <td width="15"><font size="2"></font> </td>

                                    <td> <font size="2">

                                      <input name="name" type="text" id="name" size="25" maxlength="80">

                                      </font></td>

                                  </tr>

                                  <tr>

                                    <td>

                                      <div align="right"> <font size="2"><strong><b>Your

                                        Email</b></strong></font></div>

                                    </td>

                                    <td><font size="2"></font> </td>

                                    <td> <font size="2">

                                      <input name="email" type="text" id="email" size="25" maxlength="80">

                                      </font></td>

                                  </tr>

                                  <tr>

                                    <td>

                                      <div align="right"><font size="2"><strong><b>Send

                                        to<br>

                                        Select the person you want to send the

                                        email to</b></strong></font></div>

                                    </td>

                                    <td> </td>

                                    <td>

                                      <select name="send_to">

                                        <option selected>select recipient</option>

                                        <option value="*****@zikkipublishing.com">Jeremy

                                        Rwakaara</option>

                                        <option value="****@zikkipublishing.com">General

                                        Info</option>

                                        <option value="*********@zikkipublishing.com">Licensing

                                        Inquiry</option>

                                        <option value="*********@zikkipublishing.com">Webmaster</option>

                                      </select>

                                    </td>

                                  </tr>

                                  <tr>

                                    <td>

                                      <div align="right"> <font size="2"><b>Phone

                                        Number</b></font></div>

                                    </td>

                                    <td><font size="2"></font> </td>

                                    <td> <font size="2">

                                      <input name="phone_no" type="text" id="phone_no">

                                      </font></td>

                                  </tr>

                                  <tr>

                                    <td height="2">

                                      <div align="right"> <font size="2">Fax Number</font></div>

                                    </td>

                                    <td height="2"><font size="2"></font> </td>

                                    <td height="2"> <font size="2">

                                      <input name="fax_no" type="text" id="fax_no">

                                      </font></td>

                                  </tr>

                                  <tr>

                                    <td>

                                      <div align="right"><font size="2">Comments

                                        or other information</font></div>

                                    </td>

                                    <td> </td>

                                    <td>

                                      <textarea name="comments" cols="25" rows="5" wrap="VIRTUAL"></textarea>

                                    </td>

                                  </tr>

                                  <tr>

                                    <td>

                                      <div align="right">

                                        <input name="required" type="hidden" id="required" value="send_to, name, company, email, phone_no">

                                      </div>

                                    </td>

                                    <td> </td>

                                    <td> </td>

                                  </tr>

                                </table>

                                <p align="center">

                                  <input type="submit" name="Submit" value="Submit">

                                </p>

</form>

Share this post


Link to post
Share on other sites

Could it have to do with this line of code?:

 

$set['email_type']= '1';/*1=smtp, 2=mail(), 3=qmail, 4=sendmail*/

 

Should the variable be 'mail' instead of 'smtp'?

Share this post


Link to post
Share on other sites

I think that it should work using SMTP...although you can try using mail instead! Check out this topic on Jacks support forum. I've never worked with the drop-down menus in his code, so it's all kinda running together in my head. Really...I just haven't had coffee yet, therefore, all that code is just slugging around in my head!

 

Good luck...you might want to post on his forum if you have further problems. I think he's out of town a lot lately, but he will eventually answer you!

Share this post


Link to post
Share on other sites

Tracy,

 

Thanks for that link. I am going to try those suggestions and see if they work.

 

:)

 

Nat

Share this post


Link to post
Share on other sites

I saw your other post and replied to it. If you post your question in my forum, it's easier for me to get to it. I would love to be able to answer questions here, too... but I check my own support forum much more frequently than I check TCH.

Share this post


Link to post
Share on other sites
I saw your other post and replied to it. If you post your question in my forum, it's easier for me to get to it. I would love to be able to answer questions here, too... but I check my own support forum much more frequently than I check TCH.

Jack,

 

Sorry.. I got sidetracked by a few things. I will get over to your forum to see if I can get to the bottom of this error when I get back to testing it.

 

Thanks for popping in here.

 

Nat

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...