Good morning!

My web site utilizes forms pretty extensively, and I've been trying to
figure out how--on one particular form, an admission application--to bcc all
copies to another address.  Depending on which campus the applicant chooses,
the app is emailed to a different person; the program director wants to
receive ALL the apps, without the other recipients knowing.  But I just
can't seem to make it work.  Of course, that might have something to do with
the fact that I'm not a programmer, which is why I'm asking for help.  Any
suggestions would be greatly appreciated!  The coding looks like this:

# Example code:

# Import a standard function, and get the HTML request and response objects.
from Products.PythonScripts.standard import html_quote
request = container.REQUEST

    mailhost=getattr(context, context.superValues('Mail Host')[0].id)
    raise AttributeError, "cant find a Mail Host object"

contacts = {
    'Bay Minette': '[EMAIL PROTECTED]',
    'Center Point': '[EMAIL PROTECTED]',
    'Pell City': '[EMAIL PROTECTED]',
    'Shelby': '[EMAIL PROTECTED]',
    'Enterprise': '[EMAIL PROTECTED]',
    'Daphne': '[EMAIL PROTECTED]',
    'Montgomery': '[EMAIL PROTECTED]'

if request.has_key('campus'):
    mTo = contacts[request['campus']]
    mTo = 'School of Business and Professional Studies

mFrom = 'School of Business and Professional Studies <[EMAIL PROTECTED]>'

if request.has_key('email') and request.has_key('first_name') and
    if request['email'] != '' and request['first_name'] != '' and
request['last_name'] != '':
      mFrom = "%s %s <%s>" % (request['first_name'], request['last_name'],

mSubj = 'SBPS Application'
print " Application Information"
print "-------------------------------------------------"
print " Term:\t\t", request['term']
print " Campus:\t", request['campus']
print "  Name:\t\t", request['prefix'], request['first_name'],
request['middle_name'], request['last_name']
print "  Preferred Name:\t\t", request['preferred_name']
print "  Maiden Name:\t\t", request['maiden_name']
print "  DOB:\t\t%s/%s/%s" % (request['dob_month'], request['dob_day'],

print "  Address:\t\t", request['address']
if request.has_key('address_2'):
    if request['address_2'] != '':
        print "\t\t\t", request['address_2']

print "  City:\t\t", request['city']
print "  State:\t\t", request['state']
print "  Zip Code:\t\t", request['zip']
print "  Email:\t\t", request['email']
print "  Home Phone:\t", request['phone_home']
print "  Work Phone:\t", request['phone_work']
print "  Cell Phone:\t", request['phone_cell']
print ""
if request.has_key('citizenship'):
    if request['citizenship'] == 'U.S.':
        print "  Citizenship:\t\t", request['citizenship']

        print "  Citizenship:\t\t", request['citizenship_other']

print "  Marital Status:\t", request['optional_martial_status']
print "  Ethnic Origin:\t", request['optional_ethnicity']
print "  Religion:\t", request['optional_religion']

if request.has_key('work_experience'): print '  Work Experience:\t',
if request.has_key('financial_aid'): print '  Financial Aid:\t\t',
if request.has_key('veteran'): print '  Veteran\'s Benefits:\t',
print ""

print 'Academic Information'
print '  High School:\t', request['high_school']
print '  City:\t\t', request['high_school_city']
print '  State:\t\t', request['high_school_state']
print '  Graduated:\t', request['high_school_graduated']
print ''

if request.has_key('school_name') and request.has_key('school_city') and
request.has_key('school_state') and request.has_key('school_credits'):
    schools = [school for school in request['school_name'] if school != '']
    i = 0

    print "Other schools attended:"
    print "-----------------------"

    for school in schools:
      print "  School:\t", school
      print "  City:\t", request['school_city'][i]
      print "  State:\t", request['school_state'][i]
      print "  Credits:\t", request['school_credits'][i]
      print ""

      i = i + 1

print "Applicable Military Training:"

if request.has_key('military_training'):
    if request['military_training'] != '':
        print request['military_training']

    else: print 'None'

print 'Source:'
print request['source']
print ""

#print request
#return printed

  mailhost.send(printed, mTo, mFrom, mSubj)


#return printed


Catherine E. Reinehr
Webmaster & Publications Designer
Huntingdon College
1500 E. Fairview Ave.
Montgomery, AL 36106
(334) 833-4429 / Flowers 207

Zope maillist  -
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to