<%@LANGUAGE="VBScript"%> <% Response.Buffer = True '============================================================================== ' Name: Form Data Emailer ' Purpose: Sends an email to the specified recipient(s) from the specified ' sender containing all form data submitted. ' Author: Darren Carter ' Date: 3/4/2003 ' Usage: For each field in the form, a line will be added to the email ' containing the field name and the field value. The field name ' will be derived from the name of the HTML form field name. If an ' underscore is used in the name, it will be replaced with a space ' in the email. For example, having the field ' ' will yield a field name of "First Name" in the email data list. ' Fields: sSender - email address of the sender of the email. ' sRecipient - email address(es) of recipient(s). The individual ' recipient addresses are separated by semicolons. ' sServer - email server to use to send the email(s). This is ' typically in the format of "mail." and the domain ' name of the sending email address (mail.mydomain.com). ' sSubject - email subject text. ' sBodyHeader - email body text which will precede the data list. ' sBodyFooter - email body text which will follow the data list. ' sRedirect - page to redirect to after email(s) is(are) sent. ' Leave blank if none. '============================================================================== 'check to see if the form was submitted If Request.Form.Count > 0 Then 'variable declaration Dim sSender, sRecipient, sSubject, sBodyHeader, sBodyFooter, sRedirect, sBody, Item, oEmail 'email sender (from) sSender = "kmacleod@kmaconsultants.ca" 'email recipient (to) sRecipient = "kmacleod@kmaconsultants.ca" 'email server to use to send the email(s) sServer = "mail.kmaconsultants.ca" 'subject of the email (subject) sSubject = "Information Request from KMA Consultants" 'email body header (body text before data) sBodyHeader = "The following information request has been received from www.kmaconsultants.ca on " & Date() & " at " & Time() & ":" 'email body footer (body text after data) sBodyFooter = "" 'merge the body header into the main body sBody = sBodyHeader & vbCrLf & vbCrlf 'url of page to redirect to once the email(s) have been sent (leave blank if none) sRedirect = "" 'merge all the form fields into the body using format - FieldName: FieldValue For Each Item In Request.Form sBody = sBody & Replace(Item,"_"," ") & ": " & Request.Form(Item).Item & vbCrLf Next 'merge the body footer into the main body sBody = sBody & vbCrLf & vbCrLf & sBodyFooter 'create a new email message Set oEmail = Server.CreateObject("JMail.Message") 'configure the new email message With oEmail 'add the sender (from) .From = sSender 'determine if there is one or many recipients If Instr(sRecipient,";") > 0 Then 'many recipients - split them out and add them individually Dim arrRecipients, iCounter arrRecipients = Split(sRecipient,";") For iCounter = 0 to UBound(arrRecipients) .AddRecipient arrRecipient(iCounter) Next Else 'one recipient .AddRecipient sRecipient End If 'add the subject of the message .Subject = sSubject 'add the body of the message .Body = sBody 'send the new email message using the specified mail server .Send sServer End With 'remove the object reference Set oEmail = Nothing If Len(sRedirect) > 0 Then Response.Redirect sRedirect End If End If %> KMA Consultants Inc. - Fundraising Consultants & Managers
KMA Consultants Inc.
 
Sitemap
 
Home A Worthy Cause Company Profile Our Services Our Clients Resources Contact Us



Please fill out this information request form as completely as possible:

Business Name*:
Contact Name*:  
Address:  
   
City / town:  
Postal / ZIP:  
Country:  
Telephone*:  
Alternate:  
Fax:  
E-mail Address:  

Please select the services you are interested in:
Planning & Implementation Study Case Development
Capital Campaigns   Various Communication Products
Annual Fund Audit & Plan   Constituency Research
Executive Search   Mentoring

Please let us know how you would prefer to be contacted:
Telephone Fax
E-mail   Regular Mail

Please use this space to tell us a bit about your organization:

 
Submit Form Reset Form