•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 455,991 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,771 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 729 | Replies: 0
![]() |
•
•
Join Date: Oct 2006
Posts: 19
Reputation:
Rep Power: 3
Solved Threads: 0
HI,
I'm trying to import data coming from a .csv file. The .csv file contains a column of coupon codes.
I have constructed a send email form made with ASP earlier. This will send a coupon code taken from the .csv file one at a time after a person completely registers the form. The coupon code from the .csv file will import on the body of the email.
I will be sending the send mail.asp code:
<%@ 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'm trying to import data coming from a .csv file. The .csv file contains a column of coupon codes.
I have constructed a send email form made with ASP earlier. This will send a coupon code taken from the .csv file one at a time after a person completely registers the form. The coupon code from the .csv file will import on the body of the email.
I will be sending the send mail.asp code:
<%@ 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"
%>
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
.net access advertisment ajax asp browser code combo custom data developer development dom dropdownlist email encryption eudora feed firefox google hardware linux microsoft mobile module mozilla msdn net news penelope phishing professional reader reuse security skin software spam spamming sql storage technology theme thunderbird weather web webmail wikipedia xml xoap
- Previous Thread: Extracting data from csv then directly put it on body of email with ASP
- Next Thread: export body of email into .txt in ASP


Linear Mode