Email Order Confirmation
%gset(sitename,www.3dcom.com)
%gset(vendorname,email)
%gset(EMailCost,60.00)
%if(%equal(%client-method%,POST),
'%set(state,%client-body%%client-query%),
'%set(state,%client-query%))
%if(%lt(%len(%form(Uname1)),2),'%redirect(email.html?%state%&Error=%url-encode("You must select a preferred user name.")))
%if(%lt(%len(%form(Uname2)),2),'%redirect(email.html?%state%&Error=%url-encode("You specify a second choice for your user name.")))
%if(%lt(%len(%form(EMail)),6),'%redirect(email.html?%state%&Error=%url-encode("A valid Email address is required.")))
%if(%lt(%len(%form(CardNum)),12),'%redirect(email.html?%state%&Error=%url-encode("The credit card number appears to be incorrect.")))
%if(%lt(%len(%form(ExpDate)),3),'%redirect(email.html?%state%&Error=%url-encode("The expiration date appears to be incorrect.")))
%gset(cleanmail,%trimleft(%trimright(%tolower(%form(EMail)))))
%if(%not(%wcmatch(%cleanmail%,*@*)),'%redirect(email.html?%state%&Error=%url-encode("The Email address does not contain an @ in it")))
%if(%not(%wcmatch(%cleanmail%,*.*)),'%redirect(email.html?%state%&Error=%url-encode("The Email address does not contain a period in it")))
%gset(cmax,%len(%cleanmail%))%gset(fixedmail,%null%)%gset(ix,0)%null(
%if(%wcmatch(%cleanmail%,*@aol.com),'%do('%gset(ch,%mid(%cleanmail%,%ix%,1))%if(%not(%equal(%ch%," ")),'%gset(fixedmail,%fixedmail%%ch%))%gset(ix,%iadd(%ix%,1)),'%lt(%ix%,%cmax%)))
%if(%wcmatch(%cleanmail%,*@compuserve.com),'%do('%gset(ch,%mid(%cleanmail%,%ix%,1))%if(%equal(%ch%,\,),'%gset(fixedmail,%fixedmail%.),'%gset(fixedmail,%fixedmail%%ch%))%gset(ix,%iadd(%ix%,1)),'%lt(%ix%,%cmax%)))
%if(%fixedmail%,%gset(cleanmail,%fixedmail%))%if(%wcmatch(%cleanmail%,*\,*),'%redirect(email.html?%state%&Error=%url-encode("The Email address should not contain a comma")))%if(%wcmatch(%cleanmail%,"* *"),'%redirect(email.html?%state%&Error=%url-encode("The Email address should not contain a space"))))
%gset(cleancc,%enumtoken(%form(CardNum),",- ",'%token%))
%gset(cleaned,%enumtoken(%form(ExpDate),",-/ ",'%token%))
%if(%lt(%len(%cleaned%),4),%gset(cleaned,0%cleaned%))
%gset(cleanamt,%fmt(%enumtoken(%EMailCost%,",-$",'%token%),2,.,%null%))
%gset(cleanzip,%null%)
%if(%zip%,%gset(cleanzip,%lpad(%iadd(%zip%,0),5,0)))
%if(%zip2%,%gset(cleanzip,%lpad(%iadd(%zip2%,0),5,0)))
%gset(reqdata,"%cleancc%,%cleaned%,%cleanamt%%if(%CleanZip%,\,%left(%CleanZip%,5))")
%do('%gset(oldlocktime,%hash-get(credit-card!lock))
%if(%oldlocktime%,'%if(%gt(%time%,%oldlocktime%),'%testandclear(credit-card!lock,%oldlocktime%)))
%gset(locktime,%iadd(%time%,60)),
'%not(%testandset(credit-card!lock,%locktime%)))
%delete(C:\\telepc/request.txt)
%delete(C:\\telepc/response.txt)
%delete(C:\\telepc/avs.txt)
%text-append(C:\\telepc/request.txt,%reqdata%)
%if(%equal(%cleancc%,1234567890123456),'%gset(response,APPROVED 12345),
'%gset(response,%exec("cmd.exe /c telepc-m&type response.txt",C:\\telepc/)))
%delete(C:\\telepc/request.txt)
%delete(C:\\telepc/response.txt)
%null(%testandclear(credit-card!lock,%locktime%))
%gset(replywas,%gettoken(%response%,%cr%,0))
%if(%equal(%left(%replywas%,11),"* Invalid A"),'%null(%try('%smtp-mail(205.179.146.226,Joann,3dcom@3dcom.com,"jamie@tgforum.com,cindy@tgforum.com",Ordering trouble,"detected at %localtime(hh:mm aa)"))'%redirect(email.html?%state%&Error=%url-encode("Your credit card transaction failed due to a system error.
Please try again in several hours."))))
%if(%equal(%left(%replywas%,1),*),'%redirect(email.html?%state%&Error=%url-encode("Your credit card authorization failed due to an error.
The response code was: %replywas%
Please correct and resubmit.")))
%if(%not(%equal(%left(%replywas%,1),A)),'%redirect(email.html?%state%&Error=%url-encode("Your credit card authorization did not go through.
Please try again using another credit card or contact: Joann@tgforum.com")))
%gset(expiredate,%fmtgtime(%iadd(%time%,31622400),m/d/yyyy))
%set(replymsg,"%crlf%Order Number: %counter(EMailctr)%crlf%
Thank you, %form(MailName), for ordering a TGForum email account!%crlf%
The cost is: $%EMailCost%%crlf%
The email address you supplied was: %cleanmail%%crlf%
%if(%form(replyOK),"Your EMail account order will be confirmed via email.",
"Your EMail account order will NOT be confirmed via email.")
You have elected to pay by credit card.
Your email account will be valid until: %expiredate%
First choice name: %UName1%
Second choice name: %Uname2%
Mailing name: %MailName%
Address: %Address%
%City%
%USState% %Zip%
%Country%
%crlf%
If any corrections are necessary, now or in the future,
please contact us at:%crlf%
3D Communications
PO Box 80588
Valley Forge, PA 19484-0588.
Email: 3dcom@3dcom.com%crlf%
Thanks again for your support,%crlf%
Cindy, Jamie, Joann, & Stef
")
%null(
%gset(extreply,
EMail Order %client-ip%
TGForum username: %client-authname%
Expiration: %expiredate%
Name1: %UName1%
Name2: %UName2%
Browser: %header(User-Agent)
Email Client: %form(EmailClient)
Email: %cleanmail% %if(%form(replyOK),[replys OK])
Mailing name: %MailName%
Address: %Address%
%City%
%USState% %Zip%
%Country%
cardholder: %form(CardName)
number: %form(CardNum) exp: %form(ExpDate) reply: %replywas%
------------------------------------------------------------------------%crlf%
)
%text-append(C:/dribble/email%month%.log,%extreply%)
%if(%and(%form(replyOK),%newreq%),'%try('%smtp-mail(205.179.146.226,Joann,3dcom@3dcom.com,"%cleanmail%",3DCom Order Confirmation,%replymsg%)))
%try('%smtp-mail(205.179.146.226,Joann,"%cleanmail%",joann@3dcom.com,EMail Order,%replymsg%%crlf%%extreply%))
%try('%smtp-mail(205.179.146.226,Joann,"%cleanmail%",stef@tgforum.com,EMail Order,%replymsg%%crlf%%extreply%))
)
%replymsg%
Back to our Main Pointers Page