<% if Request.Form("submit") = "Submit" then dim fs,f Dim DateTime ShortDate = Replace(FormatDateTime(date(),vbshortdate), "/", "-") LongTime = Replace(FormatDateTime(now(),vblongtime), ":", "-") DateTime = ShortDate & " " & LongTime set fs=Server.CreateObject("Scripting.FileSystemObject") set f=fs.CreateTextFile(Server.MapPath("csv\"&DateTime&".csv") ,true) f.writeline( "First Name" & "," & "Last Name" & "," & "Company" & "," & "Address" & "," & "City" & "," & "State" & "," & "Zip" & "," & "Telephone" & "," & "Email" & "," & "Subject" & "," & "Feedback" & ",") f.writeline( Request.Form("fname") & "," & Request.Form("lname") & "," & Request.Form("company") & "," & Request.Form("address") & "," & Request.Form("city") & "," & Request.Form("state") & "," & Request.Form("zip") & "," & Request.Form("telephone") & "," & Request.Form("email") & "," & Request.Form("subject") & "," & Request.Form("feedback") & ",") f.close set f=nothing set fs=nothing dim fname,lname,company,address,city,state,zip,telephone,email,subject,feedback message = "First Name: "&Request.Form("fname")&"
"&"Last Name: "&Request.Form("lname")&"
"&"Company: "&Request.Form("company")&"
"&"Address: "&Request.Form("address")&"
"&"City: "&Request.Form("city")&"
"&"State: "&Request.Form("state")&"
"&"Zip: "&Request.Form("zip")&"
"&"Telephone: "&Request.Form("telephone")&"
"&"Email: "&Request.Form("email")&"
"&"Subject: "&Request.Form("subject")&"
"&"Feedback: "&Request.Form("feedback")&"
" Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") Set Flds = iConf.Fields ' send one copy with Google SMTP server (with autentication) schema = "http://schemas.microsoft.com/cdo/configuration/" Flds.Item(schema & "sendusing") = 2 Flds.Item(schema & "smtpserver") = "smtp.gmail.com" Flds.Item(schema & "smtpserverport") = 465 Flds.Item(schema & "smtpauthenticate") = 1 Flds.Item(schema & "sendusername") = "aclarkprinting@gmail.com" Flds.Item(schema & "sendpassword") = "M@y20th1979" Flds.Item(schema & "smtpusessl") = 1 Flds.Update With iMsg .To = "martyg@alexanderclark.com" .Bcc = "jowens@criadvantage.com" & ";" & "tgcalas@yahoo.com" .From = "aclarkprinting@gmail.com" .Subject = "Alexander Clark printing" .HTMLBody = message .Sender = "Alexander Clark Printing" .ReplyTo = "aclarkprinting@gmail.com" .AddAttachment Server.MapPath("csv\"&DateTime&".csv") Set .Configuration = iConf SendEmailGmail = .Send End With set iMsg = nothing set iConf = nothing set Flds = nothing Response.redirect "ThankYou.htm" End if %> Alexander Clark Printing
Header