8791 sujets

Développement web côté serveur, CMS

Bonjour,

J'ai un formulaire que j'aimerais valider mais ça ne marche pas. Je ne peux pas valider le formulaire en javascript car ma page d'envois de courriel n'est pas sur le même serveur et j'utilise des Select Case

Voici ce que j'ai essayer:

<%
sendUrl="http://schemas.microsoft.com/cdo/configuration/sendusing"
smtpUrl="http://schemas.microsoft.com/cdo/configuration/smtpserver"

' Set the mail server configuration
Set objConfig=CreateObject("CDO.Configuration")
objConfig.Fields.Item(sendUrl)=2 ' cdoSendUsingPort
objConfig.Fields.Item(smtpUrl)="relay-hosting.secureserver.net"
objConfig.Fields.Update


' Create and send the mail
Set objMail=CreateObject("CDO.Message")
' Use the config object created above
Set objMail.Configuration=objConfig
if request.form("email") <> ""
	objMail.From = """chose@somewhere.ca""" & request.form("email")
	objMail.ReplyTo= request.form("email")
else
   response.write ("Veuillez indique votre courriel")
end if
objMail.To="myadress@somewhere.ca"
objMail.Subject="Abonnement"
objMail.HTMLBody= "<table border='1' cellspacing='0' cellpadding='0' width='600'><tr><td width='300'><p><strong>Magazine</strong></p></td><td width='300'><p>"
select case cstr(request.form("choix"))
case "btn1"
objMail.HTMLBody= objMail.HTMLBody & "Carcare Business"
case "btn2"
objMail.HTMLBody= objMail.HTMLBody & "Tire News"
if request.form("company") <> ""
	objMail.HTMLBody= objMail.HTMLBody & request.form("company")
else
   response.write ("Veuillez indique votre nom")
end if
if request.form("name") <> ""
objMail.HTMLBody= objMail.HTMLBody & request.form("name")
else
   response.write ("Veuillez indique votre nom")
end if
objMail.Send
response.redirect "http://www.autosphere.ca/fr/merci-abonnement.html"
%>


Merci

Fred