%option explicit%>
[an error occurred while processing this directive]
<%
sub ExecuteMail(mailtype,My_from,my_fromaddress,my_to,my_toaddress,my_subject,body,emailformat,Orderattachments, Orderattachmentcount)
'*****************************************************************************
' Version 5.00
' CDONTS, ASPMAIL, JMAIL, ASPEMAIL,OCXMAIL, CDOSYS, DUNDAS
' April 3, 2003 MYSQL
'*****************************************************************************
dim mailer
dim mailerror
dim htmlformat
dim i
'my_system=getconfig("xemailsystem")
htmlformat=ucase(emailformat)
on error resume next
If getconfig("xdebug")="Yes" then
Debugwrite "to=" & my_to & "(" & my_toaddress &") from=" & my_from &"("& my_fromaddress &")"
debugwrite "attachments=" & orderattachmentcount
debugwrite body
end if
If ucase(mailtype)="CDONTS" Then
Set Mailer = Server.CreateObject("CDONTS.NewMail")
if err.number<> 0 then
mailerror= getlang("langmailerror") & " " & mailtype
HandleMailError mailerror
exit sub
end if
Mailer.To = my_toaddress
Mailer.From = my_from & " <" & my_fromaddress & ">"
Mailer.Subject = my_subject
Mailer.Body = body
If htmlformat="HTML" then
Mailer.BodyFormat = 0
Mailer.MailFormat = 0
end if
If Orderattachmentcount>0 then
for i = 0 to orderattachmentcount-1
Mailer.AttachFile orderattachments(i)
If getconfig("xdebug")="Yes" then
Debugwrite "adding " & orderattachments(i)
end if
next
Orderattachmentcount=0
end if
Mailer.Send
set mailer=nothing
exit sub
end if
if ucase(mailtype)="ASPMAIL" then
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
' response.write "mail error " & err.number
if err.number<> 0 then
mailerror= getlang("langmailerror") & " " & mailtype
HandleMailError mailerror
exit sub
end if
Mailer.AddRecipient my_to, my_toaddress
Mailer.RemoteHost = my_system
Mailer.FromName = my_from
Mailer.FromAddress = my_fromAddress
Mailer.Subject = my_subject
Mailer.BodyText=body
If htmlformat="HTML" then
Mailer.ContentType = "text/html"
end if
If Orderattachmentcount>0 then
for i = 0 to orderattachmentcount-1
Mailer.AddAttachment orderattachments(i)
next
end if
If Mailer.SendMail then
set Mailer=nothing
exit sub
else
mailerror= getlang("langmailerror") & " " & my_toaddress
mailerror=mailerror & "
" & mailer.response
HandleMailError mailerror
Set mailer=nothing
exit sub
end if
end if
If ucase(Mailtype) = "JMAIL" Then
Set Mailer = Server.CreateObject("JMail.SMTPMail")
if err.number<> 0 then
mailerror= getlang("langmailerror") & " " & mailtype
HandleMailError mailerror
exit sub
end if
Mailer.ServerAddress = my_system
Mailer.Sender = my_fromAddress
Mailer.SenderName = my_from
Mailer.AddRecipient my_toaddress
Mailer.Subject = my_subject
If htmlformat="HTML" then
Mailer.ContentType = "text/html"
end if
Mailer.Body = body
If Orderattachmentcount>0 then
for i = 0 to orderattachmentcount-1
Mailer.AddAttachment orderattachments(i)
next
end if
If Mailer.execute then
set Mailer=nothing
exit sub
else
mailerror= getlang("langmailerror") & " " & my_toaddress
HandleMailError mailerror
set mailer=nothing
exit sub
end if
end if
If ucase(Mailtype) = "ASPEMAIL" Then
Set Mailer = Server.CreateObject("Persits.MailSender")
if err.number<> 0 then
exit sub
end if
Mailer.Host = my_system
Mailer.From = my_fromAddress
Mailer.FromName = my_from
Mailer.AddAddress my_toaddress, my_to
Mailer.Subject = my_subject
If htmlformat="HTML" then
Mailer.IsHTML = TRUE
end if
If Orderattachmentcount>0 then
for i = 0 to orderattachmentcount-1
Mailer.AddAttachment orderattachments(i)
next
end if
Mailer.Body = body
If Mailer.Send then
set Mailer=nothing
exit sub
else
mailerror= getlang("langmailerror") & " " & my_toaddress
HandleMailError mailerror
set mailer=nothing
exit sub
end if
end if
If ucase(Mailtype) = "OCXMAIL" Then
Set mailer = Server.CreateObject("ASPMAIL.ASPMailCtrl.1")
If htmlformat="HTML" then
dim result
result=Mailer.XHeader ("Content-Type", "text/html")
end if
mailerror = mailer.SendMail(my_system, my_toaddress, my_fromaddress, my_subject, body)
If "" = mailerror Then
Set mailer=nothing
exit sub
Else
mailerror= getlang("langmailerror") & " " & my_toaddress & VbCR & mailerror
HandleMailError mailerror
set mailer=nothing
End If
exit sub
End IF
If ucase(Mailtype) = "DUNDAS" Then
Set mailer = Server.CreateObject("Dundas.Mailer") 'Mailer object
mailer.TOs.Add my_toaddress, my_to
mailer.Subject = my_subject
mailer.SMTPRelayServers.Add my_system
mailer.FromAddress = my_fromaddress
mailer.Fromname = my_from
If htmlformat="HTML" then
Mailer.HTMLBody = body
else
mailer.Body = body
end if
If Orderattachmentcount>0 then
for i = 0 to orderattachmentcount-1
mailer.Attachments.Add orderattachments(i)
next
end if
mailer.SendMail
'test for success/failure of the SendMail operation using VBScript's Err object
If Err.Number <> 0 Then
'an error occurred so output the relevant error string
mailerror= getlang("langmailerror") & " " & my_toaddress & " The following error occurred: " & Err.Description
HandleMailError mailerror
End if
Set mailer = Nothing 'release resources
exit sub
End If
'
mailerror= getlang("langmailerror") & " " & mailtype
HandleMailError mailerror
end sub
Sub HandleMailerror (errormsg)
SetSess "mailerror",errormsg
If getconfig("xDebug")="Yes" then
debugwrite errormsg
end if
end sub
%>
<%
'**************************************************************************
' Tell a Friend
' VP-ASP 5.00 Jan 9, 2003
' shoptellafriend.asp?id=xxx
' shoptellafriend.asp
' Sept 29, 2003 add check for numeric on id
'*************************************************************************
Dim CR
CR=GetMailCR
Dim strMessage
Dim sAction
Dim my_to
Dim my_toaddress
Dim my_from
Dim my_fromaddress
Dim my_subject,mailtype
Dim my_system
Dim mailer
Dim my_attachment
Dim body
Dim strCustName
Dim strCustEmail
Dim strFriendsName
Dim strFriendsEmail
Dim id
Dim cPrice
Dim extDescription
Dim ccode
dim mailid, ProductMessage
Dim TellafriendSubject
sError=""
'=======================
' Entry Point
'=======================
id=request("id")
If not isnumeric(id) then
id=""
end if
sAction=Request("Action")
if sAction="" then
sAction=Request("Action.x")
end if
If sAction = "" Then
ShopPageHeader
DisplayForm()
ShopPageTrailer
Else
ValidateData()
if sError = "" Then
SendMail
WriteInfoMessage
else
ShopPageHeader
DisplayForm
ShopPageTrailer
end if
end if
'=======================
' Sub DisplayForm
'=======================
Sub DisplayForm()
GetProductInfo
If sError<>"" then
shopwriteError Serror
end if
shopwriteheader getlang("LangTellaFriendHeader")
response.write "
"
Response.Write("