doraima29 0 Newbie Poster

I'm trying to export body of email into .txt.

here is the sendmail.asp:

<%@ Language=VBScript %>

<%
Option Explicit
%>

<%
' -----------------------------------------------------
' CDONTS Email send script
' © http://www.designplace.org/
' Comments must remain intact for re-use of this code
' -----------------------------------------------------

dim strName, strEmailOne, strEmailTwo, strMessage, optSuggestions, strEmailTo

strName = Request.Form("name") ' holds inputted name
'strEmailOne = Request.Form("emailOne") ' holds inputted email address
strEmailTwo = Request.Form("emailTwo") ' holds inputted email address
strMessage = Request.Form("message") ' holds inputted message
optSuggestions = Request.Form("suggestions").Item ' drop down list selection

' -- check all fields for empty values --
' -- remove and add new as required --

if strMessage = "" then
Response.Redirect "suggestion_box.asp?action=err4"
end if

' if strName = "" then
' Response.Redirect "suggestion_box.asp?action=err1"
' else if strEmailOne = "" then
' Response.Redirect "suggestion_box.asp?action=err2"
' else if strEmailTwo = "" then
'Response.Redirect "suggestion_box.asp?action=err3"
'else if strMessage = "" then
'Response.Redirect "suggestion_box.asp?action=err4"
'else if optSuggestions = "" then
'Response.Redirect "suggestion_box.asp?action=err5"
'end if
'end if
'end if
'end if
'end if

' -- start determine correct send to address based on suggestion type --

Select Case optSuggestions

Case "Web Enhancements"
strEmailTo = "person1@offemail.com"

Case "Application Enhancements"
strEmailTo = "person2@offemail.com"

Case "New Product Suggestions"
strEmailTo = "person2@offemail.com"

Case "Workplace Suggestions"
strEmailTo = "person3@offemail.com"

Case "Employee Recognition"
strEmailTo = "person3@offemail.com"

Case "Cultural Events"
strEmailTo = "person3@offemail.com"

Case "Other"
strEmailTo = "person3@offemail.com"

Case Else
strEmailTo = "feedback@offemail.com"

End Select

' -- end determine correct send to address based on suggestion type --

' -- begin email send process --

dim objMail

Set objMail = Server.CreateObject("CDO.Message")
'Set objMail = CreateObject("CDONTS.NewMail")

' -- email variables --
objMail.From = Trim("feedback@offemail.com")
objMail.To = Trim(strEmailTo)
objMail.Subject = "Put name of program here"
'objMail.BodyFormat = "0" ' HTML format
objMail.TextBody = "put message here:" & vbCrLf _
& vbCrLf _
& "Question 1: " & Trim(optSuggestions) & vbCrLf _
& vbCrLf _
& "Message: " & Trim(strMessage)

' -- send the email --
objMail.Send()

' -- clean up object
Set objMail = Nothing

' -- execute confirmation page
Response.Redirect "thankyou.asp"
%>
-----------------------------------------------
I wonder if it's possible to export the body of the email to a txt file. Any suggestions are appreciated!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.