User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Oct 2006
Posts: 19
Reputation: doraima29 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
doraima29 doraima29 is offline Offline
Newbie Poster

Help Importing data from .csv then putting this on body of email

  #1  
Dec 6th, 2007
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"
%>
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the ASP Forum

All times are GMT -4. The time now is 9:35 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC