<% Dim from_mail, from_name, subject_mail, receivers, use_builtin_host_and_port, smtphost, smtpport, required_fields, email_field, contact_html_pagina, page_to_redirect_after_sending, email_not_valid, required_field_not_valid ' --------------------------------------------------------------------------------------------------------- ' CONFIGZONE: Hier komen de variabele velden in, zoals de ontvangers, het onderwerp van de mail, etc... from_mail = "webmaster.development@coleurop.be" from_name = "College of Europe's Development Office" subject_mail = "Un/Subscribe form DO Newsletter - SHORT" receivers = Array("jvanloo@coleurop.be") use_builtin_host_and_port = True 'als dit op true staat wordt er met smtphost en met smtpport geen rekening gehouden, als dit op false staat wordt smtphost en smtpport als smtp server met desbetreffende poort gebruikt smtphost = "smtp.coleurop.be" smtpport = 25 'standaardpoort is 25 'required_fields = Array() required_fields = Array("Name","E-mail") email_field = "E-mail" contact_html_pagina = "formmail-DONL-short.html" page_to_redirect_after_sending = "formmail-DONL-confirmation.html" email_not_valid = "Email is required" required_field_not_valid = "#REQUIRED_FIELD# is required" ' END CONFIGZONE ' --------------------------------------------------------------------------------------------------------- If Len(Request.Form) > 0 Then 'dit is een postback, vang gegevens op en verwerk ze. Dim isValid, received_values(), contact_html_to_send, fileStream, fileToRead isValid = True Set fileStream = Server.CreateObject("Scripting.FileSystemObject") Set fileToRead = fileStream.OpenTextFile(Server.MapPath(contact_html_pagina), 1) contact_html_to_send = fileToRead.ReadAll fileToRead.Close Set fileToRead = Nothing Set fileStream = Nothing Dim formEntryKey, firstTime firstTime = True For Each formEntryKey in Request.Form Dim formEntryValue formEntryValue = Request.Form(formEntryKey) If firstTime = True Then Redim received_values(0) firstTime = False Else Redim PRESERVE received_values(UBound(received_values) + 1) End If received_values(UBound(received_values)) = formEntryKey If formEntryValue = "" And in_array(formEntryKey, required_fields) Then isValid = False message_to_popup = Replace(required_field_not_valid, "#REQUIRED_FIELD#", formEntryKey) End If If formEntryKey = email_field Then If formEntryValue = "" And in_array(formEntryKey, required_fields) Then isValid = False message_to_popup = Replace(required_field_not_valid, "#REQUIRED_FIELD#", formEntryKey) Else Dim regularExpressionObject Set regularExpressionObject = New RegExp regularExpressionObject.Pattern = "^[A-Z0-9._-]+@[A-Z0-9][A-Z0-9.-]{0,61}[A-Z0-9]\.[A-Z.]{2,6}$" regularExpressionObject.IgnoreCase = True regularExpressionObject.Global = True If Not regularExpressionObject.Test(formEntryValue) Then isValid = False message_to_popup = email_not_valid End If Set regularExpressionObject = Nothing End If End If If isValid = False Then Exit For End If contact_html_to_send = Replace(contact_html_to_send, "#" + UCase(formEntryKey) + "#", Replace(formEntryValue, VbCrLf, "
") ) Next If isValid = True Then Dim required_field For Each required_field in required_fields If Not in_array(required_field, received_values) Then isValid = False message_to_popup = Replace(required_field_not_valid, "#REQUIRED_FIELD#", required_field) Exit For End If Next End If If isValid = True Then Dim mail Set mail = CreateObject("CDO.Message") If Not use_builtin_host_and_port Then mail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 mail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = smtphost mail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = smtpport mail.Configuration.Fields.Update End If mail.From = from_name + " <" + from_mail + ">" mail.HTMLBody = contact_html_to_send mail.Subject = subject_mail Dim receiver, stringTo stringTo = "" For Each receiver in receivers stringTo = stringTo + receiver + ";" Next If Len(stringTo) > 1 Then stringTo = Left(stringTo, Len(stringTo) - 1) End If mail.To = stringTo mail.Send Set mail = Nothing Response.Redirect(page_to_redirect_after_sending) End If End If Private Function in_array(stringToSearchFor, arrayToSearchIn) Dim key, boolToReturn boolToReturn = False For Each key in arrayToSearchIn If stringToSearchFor = key Then boolToReturn = True Exit For End If Next in_array = boolToReturn End Function %> College of Europe's Development Office Newsletter

Newsletter Archive

» Development Office Newsletter: Issue N°1 2012

Open Registrations

Column

Announcements and Activities

Read newsletter...

» Development Office Newsletter: Issue N°4 2011

Open Registrations

Column

Announcements

Activities

Read newsletter...

 

» Development Office Newsletter: Issue N°3 2011

» Development Office Newsletter: Issue N°2 2011

» Development Office Newsletter: Issue N°1 2011

» Development Office Newsletter: Issue N°5 2010

» Development Office Newsletter: Issue N°4 2010

» Development Office Newsletter: Issue N°3 2010

» Development Office Newsletter: Issue N°2 2010

» Development Office Newsletter: Issue N°1 2010

» DO Newsletter: September/October Issue 2009

» DO Newsletter: July/August Issue 2009

» DO Newsletter: May/June Issue 2009

» DO Newsletter: March/April Issue 2009

» DO Newsletter: January/February Issue 2009

» Vol. 4, no. 5 - October - November - December 2008

Training Activities

  • EU Fact Finding, the EU at your fingertips!
  • Regulatory Impact Analysis
  • Intensive Seminar on the EU

Recent Events and Projects

  • The European Parliament Visitors Centre multimodal role-play game
  • Transfers of Persons in Situations of Armed Conflict
  • Training Programmes on EU Terminology
  • EU Negotiations in Practice – the formula just proved again its success
  • EU Fact Finding – for the Swiss Mission to the EU

Staff News

Read newsletter...

» Vol. 4, no. 4 - August - September 2008

Training Activities

  • EU Negotiations in Practice
  • EU Fact Finding, the EU at your fingertips!
  • Regulatory Impact Analysis

Recent Events and Projects

  • European Studies in Russia
  • International Forum on Diplomatic Training
  • Workshop: “EU through the Eyes of Asia”
  • Leadership Development Programme for South-Eastern Europe – Third edition
  • Conferences for the EUROPE DIRECT Network

Staff News

Read newsletter...

» Vol. 4, no. 3 - June - July 2008

Training Activities

  • EU Negotiations in Practice
  • Regulatory Impact Analysis
  • EU Fact Finding, the EU at your fingertips!

Recent Events and Projects

  • Intensive Seminar on the EU
  • Training Seminar for the European Commission’s EUROPE DIRECT Network held at new College facilities
  • Conferences in OHIM Alicante and Expo Zaragoza 2008
  • From Early Warning to Early Action

Staff News

Read newsletter...

» Vol. 4, no. 2 - April - May 2008

Training Activities

  • EU Executive Programme, Climate Change, Energy & Sustainable Business Development
  • EU Fact Finding, the EU at your fingertips!
  • Regulatory Impact Analysis
  • Intensive Seminar on the EU (15th edition!)
  • EU Negotiations in Practice

Recent Events and Projects

  • European Conference on Social Policy
  • EU Negotiations
  • Tailor made training programmes on EU Affairs and EU programme/project management for future consultants and administrators
  • Conferences and workshops for communication specialists on EU affairs

Staff News

Read newsletter...

» Vol. 4, no. 1 - February - March 2008

Training Activities

  • EU Executive Programme, Corporate Social Responsibility & Ethics – Business Needs & Regulatory Compliance
  • European Conference on Social Policy
  • EU Fact Finding, the EU at your fingertips!
  • EU Executive Programme EU-Russia Relations: Business Perspective
  • EU Negotiations in Practice
  • Regulatory Impact Analysis
  • Intensive Seminar on the EU (15th edition!)

Recent Events and Projects

  • A successful bid for the European Parliament’s future Visitors Centre
  • EU Executive Programme – hand in hand with business

Staff News

Read newsletter...

» Vol. 3, no. 4 - November - December 2007

Training Activities

  • Regulatory Impact Analysis
  • EU Negotiations in Practice
  • EU Fact Finding, the EU at your fingertips!
  • 15th Intensive Seminar on the EU

Recent Events and Projects

  • EU Executive Programme – Hand in hand with business
  • Creating Hydrogen Communities
  • Conferences for the European Commission’s EUROPE DIRECT Network
  • Continued cooperation with Seoul National University

Staff News

Read newsletter...

» Vol. 3, no. 3 - September 2007

Training Activities

  • EU Fact Finding - the EU at your fingertips!
  • EU Executive Seminar - Business Implications of Climate Change
  • EU Negotiations in Practice

Recent Events and Projects

  • 14th Intensive Seminar

Staff News

Read newsletter...

» Vol. 3, no. 2 - April 2007

Training Activities

  • "EU competition law and state aids" in Istanbul
  • Intensive Seminar on the European Union
  • EU Negotiations in Practice
  • EU Fact Finding – Short Course

Recent Events and Projects

  • Regulatory Impact Analysis (RIA) – A rising demand for training
  • Seminar on European Integration for post-graduate students from Puglia, Italy
  • A cooperation for South-East Europe
  • Cooperation with the International Committee of the Red Cross (ICRC)

Staff News

Read newsletter...

» Vol. 3, no. 1 - February 2007

Training Activities

  • EU Trade Policy & the WTO – Workshop
  • EU Fact Finding – Short Course
  • Intensive Seminar on the European Union
  • Regulatory Impact Analysis - Training Course

Recent Events and Projects

  • Istanbul - Successful launch of the EU Focus Sessions
  • Training on International Law for DG Trade Officials
  • Moscow – Launch of a new TEMPUS-Programme

Staff News

Read newsletter...

» Vol. 2, no. 5 - December 2006

Training Activities

  • Advanced Community Law Training (ACLT) Programme
  • EU Policy Workshops in Brussels: “Europe in the World”
  • College of Europe starts cooperation with Kadir Has University / Turkey
  • 2nd Edition of our Regulatory Impact Analysis Training Course (RIA)
  • EU Fact Finding

Official opening of European Studies Institute in Moscow

Read newsletter...