<% ' Create Connection Function GetEmailConnection () Set oMail = CreateObject("CDO.Message") Set GetEmailConnection = oMail End function Function GetConfiguration() Set oConfig = CreateObject("CDO.Configuration") Set GetConfiguration = oConfig End Function ' Send Email Sub SendEmail (fromAddress, toAddress, subject, body) set objMessage = GetEmailConnection() Set objConfiguration = GetConfiguration() Set fields = objConfiguration.Fields mailServer = "mail1.defgo.com" useSSL = 0 port = 25 // typical values 25, 465, 587 usePassword = 0 username = "" password = "" Const cdoSendUsingPort = 2 With fields .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = mailServer .Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = useSSL .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = port .Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = usePassword .Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = password .Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = username .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 15 .Update End With With objMessage set .Configuration = objConfiguration .Subject = subject .From = fromAddress .To= toAddress .TextBody = body .TextBodyPart.Charset = "utf-8" on error resume next .Send If Err.Number <> 0 Then Response.Write (Err.Description) end if End With set objMessage = nothing end Sub Function SimpleBinaryToString(Binary) 'SimpleBinaryToString converts binary data (VT_UI1 | VT_ARRAY Or MultiByte string) 'to a string (BSTR) using MultiByte VBS functions Dim I, S For I = 1 To LenB(Binary) S = S & Chr(AscB(MidB(Binary, I, 1))) Next SimpleBinaryToString = S End Function sendTo = Request("sendTo") subject = Request("subject") bodyStart = Request("bodyStart") testappIP= "79.174.184.x" app01IP = "192.168.10.x" currentIP = Request.ServerVariables("remote_addr") answersStr1 = Request.Form("surveyAnswers") answersStrLines = Replace(answersStr1, ";", vbCrLf & "---" & vbCrLf) answersStrLines = Replace(answersStrLines, " ", vbCrLf & vbCrLf & vbCrLf, 1, 1) answersStrLines = Replace(answersStrLines, " ", vbCrLf) if currentIP=testappIP or currentIP=app01IP then SendEmail "info@defgo.net", sendTo, subject , bodyStart & vbCrLf & vbCrLf & "Form(""surveyAnswers""): " & vbCrLf & answersStr1 & vbCrLf & vbCrLf & vbCrLf & vbCrLf & "Answers at each line: " & vbCrLf & answersStrLines %>
Whitelisted IP used.
Mail sent to <%= sendTo %>. <% else %> API - Automatic export of respondent answers to a remote server - initiated by respondent (push) API - Automatic export of respondent answers to a remote server - initiated by respondent (push)

This example will send an email with submitted answers.

Usage:
URL: https://www.defgo.net/tools/webservices/exportAutomatic.asp?sendTo=RECIPIENT-ADDRESS&subject=SUBJECT&bodyStart=START-OF-MAILTEXT
Example: https://www.defgo.net/tools/webservices/exportAutomatic.asp?sendTo=example%40interresearch.dk&subject=Test%20of%20auto%20export&bodyStart=This%20is%20the%20answers%3A%20

Format: CSV
<% end if %>