Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I've tried this code repeatedly; there's no error, but it's not sending, either. Is there an issue I'm not seeing, or do I need to talk to my hosting service?

<?php require_once ( 'couch/cms.php' ); ?>
<cms:template name="volunteer_application" title="Volunteer Application" clonable='1'>
<cms:editable type='text' name='coordinator_email' label='Volunteer Coordinator Email' validator='email' />
</cms:template>
<!DOCTYPE HTML>
<html>
<head>
<cms:embed 'header.html' />
</head>
<body>
<div class="container-fluid">
<cms:embed 'menu.html' />

<div class="panel panel-default">
<div class="panel-heading">
<h2>Library Volunteer Application</h2>
</div>
<div class="panel-body">
<h4 class="bg-warning text-center">If you need to volunteer to fulfil court-ordered community service, please speak with your desired volunteer location <em>before</em> submitting this application.</h4>
<cms:form enctype="multipart/form-data" method="post" class="k_form">
<cms:if k_success >
<div class="k_successmessage bg-success">
<cms:send_mail from="volunteer_application@test.com" to="<cms:show coordinator_email />" subject='Volunteer Application'>
<b>***DO NOT RESPOND TO THIS EMAIL***</b><br/>
The following Volunteer Application was submitted:
<cms:show k_success />
</cms:send_mail>
<h3>Message sent</h3>
</div>
</cms:if>
<cms:if k_error >
<div class="k_errormessage bg-danger">
<ul>
<cms:each k_error >
<li><cms:show item /></li>
</cms:each>
</ul>
</div>
</cms:if>
<cms:fieldset label="Personal Information">
<p><cms:input name="volunteer_name" label="Your Full Name: " type="text" size="15" maxlength="40" required='1' validator_msg="required=Please enter your name." /></p>

<p><strong>Today's Date:</strong><br/><cms:input name="volunteer_date" label="Today's Date: " type="datetime" required="1" validator_msg="required=Please enter today's date." /></p>

<p><cms:input name="volunteer_phone_number" label="Phone Number (in xxx-xxx-xxxx format): " type="text" size="12" validator="regex=/\d{3}-\d{3}-\d{4}/" required='1' validator_msg='regex=Please input a valid phone number. | required=Please input a phone number.' /></p>

<p><cms:input name="volunteer_street_address" label="Street Address: " type="text" size="14" required='1' validator_msg='required=Please enter your street address.' /></p>

<p><cms:input name="volunteer_city" label="City: " type="text" size="14" required='1' validator_msg='required=Please enter your city of residence.' /></p>

<p><cms:input name="volunteer_state" label="State: " type="text" size="2" validator="exact_len=2" required='1' validator_msg='exact_len=Enter a valid state code. | required=Enter your state of residence.' /></p>

<p><cms:input name="volunteer_zip" label="Zip Code: " type="text" size="5" validator="exact_len=5" required='1' validator_msg="exact_len=Please enter your 5-digit zip code. | required=Please enter your 5-digit zip code." /></p>

<p><cms:input name="volunteer_age" label="Your Age: " type="dropdown" opt_values=" 12-15 | 16-18 | 19-25 | 26-36 | 37-54 | 55-64 | 65+ " required='1' validator_msg="required=Please select your age range." /></p>

<p><cms:input name="volunteer_email" label="If you would like to be contacted by email, please provide your address: " type="text" size="15" validator="email" validator_msg='email=Please input a valid e-mail address.' /></p>

<p><cms:input type="dropdown" label="Where would you like to volunteer? " name="volunteer_branch" opt_values="Opt | Values" required='1' validator_msg='required=Please select a branch.' /></p>

</cms:fieldset>

<cms:fieldset label="Education">
<p><cms:input name="current_school" label="Current School (if in school): " type="text" size="15" /></p>

<p><cms:input name="education_level" label="Highest Grade Completed: " type="dropdown" opt_values=" 6 | 7 | 8 | 9 | 10 | 11 | 12 | Bachelor's | Master's | Doctorate " /></p>

<p><cms:input name="volunteer_languages" label="Languages Spoken other than English: " type="text" size="15" /></p>

</cms:fieldset>

<cms:fieldset label="Employment History">
<p><cms:input name="current_employer" label="Current or Most Recent Employer: " type="text" size="30" /></p>

<p><cms:input name="volunteer_title" label="Title or Job Description: " type="text" size="15" /></p>

<p><cms:input name="volunteer_duties" label="Job Duties: " type="textarea" rows="5" cols="20" wrap="physical" /></p>

</cms:fieldset>

<cms:fieldset label="Volunteer Experience">
<p><cms:input name="previous_volunteer" label="Have you ever volunteered previously? " type="checkbox" opt_values=" Yes | No " required='1' validator_msg="required=Please indicate if you have prior volunteer experience." /></p>

<p><cms:input type="textarea" rows="5" cols="20" wrap="physical" label="If so, where, and what were your duties? " name="previous_volunteer_information" /></p>

</cms:fieldset>

<cms:fieldset label="Interests and Skills">
<p><cms:input type="textarea" rows="5" cols="20" wrap="physical" required='1' label="List your hobbies and interests: " name="volunteer_hobbies" validator_msg="required=Please list at least one hobby or interest." /></p>

<p><cms:input type="textarea" rows="5" cols="20" wrap="physical" required='1' label="What skills do you possess that would be helpful at the library? " name="volunteer_skills" validator_msg="required=Please list at least one skill." /></p>

<p><cms:input type="textarea" rows="5" cols="20" wrap="physical" label="What information do we need to know that may be helpful in placing you as a volunteer at the library? " name="volunteer_placement" /></p>

</cms:fieldset>

<cms:fieldset label="Emergency Contacts">
<p><cms:input name="emergency_contact_one_name" label="First Emergency Contact: " type="text" size="15" maxlength="40" required='1' validator_msg="required=Please enter at least one emergency contact." /></p>

<p><cms:input name="e_contact_one_phone_number" label="First Contact's Phone Number (in xxx-xxx-xxxx format): " type="text" size="12" validator="regex=/\d{3}-\d{3}-\d{4}/" required='1' validator_msg='regex=Please input a valid phone number for your first emergency contact. | required=Please input a phone number for your first emergency contact.' /></p>

<p><cms:input name="emergency_contact_two_name" label="Second Emergency Contact: " type="text" size="15" maxlength="40" /></p>

<p><cms:input name="e_contact_two_phone_number" label="Second Contact's Phone Number (in xxx-xxx-xxxx format): " type="text" size="12" validator="regex=/\d{3}-\d{3}-\d{4}/" validator_msg='regex=Please input a valid phone number.' /></p>

</cms:fieldset>

<cms:fieldset label="Other Information">
<p><cms:input type="checkbox" name="criminal_history" label="Have you ever been convicted of or pled guilty to a felony or misdemeanor, other than a minor traffic violation? (Conviction or plea will not necessarily disqualify applicant, but will require a background check.)" opt_values=" Yes | No " required='1' validator_msg="required=Please answer the question concerning prior criminal convictions." /></p>

<p><cms:input type="checkbox" name="community_service" label="Are you volunteering to fulfill a community service requirement? " opt_values=" Yes | No " required='1' validation_msg="required=Please indicate if you are volunteering to fulfil a community service requirement." /></p>

<p><cms:input name="community_service_reason" label="If you wish to volunteer to fulfill a court-appointed community service requirement, please speak with library staff before completing this form. If you are requesting a volunteer opportunity to fulfill any other type of service requirement, please describe your requirement: " type="textarea" rows="5" cols="20" wrap="physical" /></p>

<p><cms:input name="community_service_hours" label="Number of hours needed: " type="text" size="5" validator="non_negative_decimal" validator_msg="non_negative_decimal=Please put a valid number in the number of hours needed to fulfil community service requirements." /></p>

<p><strong>Date by which Community Service must be Completed: <cms:input name="community_service_date" label="Community Service Required Completion Date: " type="datetime" /></strong></p>

<p><cms:input name="volunteer_availability" label="Please detail the times and days when you are available to volunteer: " type="textarea" rows="5" cols="20" wrap="physical" /></p>

</cms:fieldset>

<cms:fieldset label="Volunteer Agreement">
<p><strong>By clicking "Submit," you certify your agreement with these statements:</p>
<p>I understand that this information will be handled confidentially and will only be disclosed to parties with proper authorization. I release this agency from any liability whatsoever when supplying such information. I certify that the statements made in this application are true and correct and have been given voluntarily. I understand that misrepresentation of any information may result in termination of my volunteer involvement. I understand that a background check may be required. I agree to abide by the rules of the library. I understand that I will not be paid for any services as a volunteer and I expect no compensation.</strong></p>

<cms:input type="checkbox" label="I certify that I am over eighteen years of age, or have permission from a parent or guardian to submit a volunteer application. I understand I will be expected proof of such if contacted to volunteer." name="volunteer_age_certification" opt_values=" By clicking this box, I affirm that I have read the above statement." required='1' validator_msg='required=You must indicate that you are either older than eighteen or have permission from a parent or guardian to submit this application.'/>

</cms:fieldset>

<button type="submit" class="btn btn-default">Submit Request</button>
</cms:form>
</div>
</div>
</div>
<cms:embed 'footer.html' />
</body>
</html>
<?php COUCH::invoke(); ?>
Hi,

Try adding the 'debug' parameter to cms:send_mail
<cms:send_mail from="volunteer_application@test.com" to="<cms:show coordinator_email />" subject='Volunteer Application' debug='1'>
This will create a log.txt file in the site's root with all the info about the mail. Please check if everything seems right there.

Another point that could be a problem is the 'from' parameter - many hosts disallow mails sent from a foreign domain i.e. try using an address form the site's domain itself.

Let us know how it goes.
Thanks.
Thank you, I was able to locate the error from there and have taken steps towards resolution.

Sam
3 posts Page 1 of 1