Bonjour! J'aimerais avoir de l'aide. Voici je n'arrive pas a faire envoyer mon email de notification apres que l'utilisation s'est enregistré. Pourtant, le tout se crée parfaitement dans la BD access, mais c'est comme si il ne veut pas continuer le script ensuite... Erreur de syntaxe??? Tres simple, il s'inscrit et l'action appelée est "1"....

MERCI!
<!--METADATA TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library" -->
<!--METADATA TYPE="typelib"
UUID="00000205-0000-0010-8000-00AA006D2EA4"
NAME="ADODB Type Library" -->
<%
Dim action
action = Request.QueryString("action")
If action = 1 Then
Dim objConnection, objRecordset, SQLs, strUserID
Dim strPassword, strFname, strLname, strAddress, strCity, strCountry
Dim strZip, strUserType, strJoinDate, strEducation, strNewsletter, strEmail, strCareer,strUnion,strMalefemale,strExperience
Set objConnection = Server.CreateObject("ADODB.Connection")
Set objRecordset = Server.CreateObject("ADODB.Recordset")
objConnection.Open Application("ConnectionString")
strUserType= 0
strFname=Replace(Request.Form("firstname"), "'", "''")
strLname=Replace(Request.Form("lastname"), "'", "''")
strAddress=(Request.Form("address"))
strCity=(Request.Form("city"))
strZip=(Request.Form("zip"))
strCountry=(Request.Form("country"))
strEmail=(Request.Form("emailaddress"))
strPassword=(Request.Form("password"))
strCareer=(Request.Form("careerlevel"))
strEducation=(Request.Form("education"))
strJoinDate=(Request.Form("joindate"))
strNewsletter=(CInt(Request.Form("newsletter")))
strUnion = (Request.Form("Union"))
strMalefemale = (Request.Form("malefemale"))
strExperience = (Request.Form("experience"))
If strNewsletter <> 1 Then
strNewletter = 0
End If
' ## ERROR CONTROL ##
objConnection.Errors.Clear ' just to be safe, clear out any existing errors
'On Error Resume Next ' then IGNORE errors!
' Put parameters in registration database.
SQLs = "INSERT INTO Users (Email, Fname, Lname, UsrPassword, Address, City, Country, Zip, " & _
"CareerLevel, Education, JoinDate, Newsletter, UserType) "
SQLs = SQLs & "VALUES ("
SQLs = SQLs & "'" & strEmail & "',"
SQLs = SQLs & " '" & strFname & "',"
SQLs = SQLs & " '" & strLname & "',"
SQLs = SQLs & " '" & strPassword & "',"
SQLs = SQLs & " '" & strAddress & "',"
SQLs = SQLs & " '" & strCity & "',"
SQLs = SQLs & " " & strCountry & ","
SQLs = SQLs & " '" & strZip & "',"
SQLs = SQLs & " '" & strCareer & "',"
SQLs = SQLs & " '" & strEducation & "',"
SQLs = SQLs & " '" & strJoinDate & "',"
SQLs = SQLs & " '" & strNewsletter & "',"
SQLs = SQLs & " " & strUserType & ")"
'Response.write SQLs
'Response.end
Application.Lock
objConnection.Execute(SQLs)
Application.Unlock
' ## ERROR CONTROL ##
'On Error GoTo 0 ' turn off the ignoring of errors!
' now see if we got any errors from the insert!
For Each oops In objConnection.Errors
If oops.number = -2147217900 Then
'If oops.number = -2147467259 Then
Session("Session_Message") = "The email address you entered already exists. <br />" & _
"<a href=""../forgotpass.asp"">Forgot password? Click here</a>"
Response.Write "That item already exists in that table!<BR>"
'Create the Query String
Dim strQueryString
strQueryString = "?firstname=" & strFname & "&lastname=" & strLname & "&address=" & strAddress & _
"&city=" & strCity & "&zip=" & strZip & "&emailaddress=" & strEmail
Response.Redirect("../candidate/contactinfo.asp" & strQueryString)
Response.End()
Else
Response.Write "Unexpected error: " & oops.number & " -- " & oops.description
Response.End()
End If
'Next
' The following assigns the new UserID to strUserID
Set objRecordset = objConnection.Execute("SELECT @@IDENTITY") ' Create a recordset and_
' SELECT the new Identity
strUserID = objRecordset(0) ' Store the value of the new identity in variable strUserID
Session("User_ID") = objRecordset("UserID")
Session("User_Type") = objRecordset("UserType")
Session("User_Name") = objRecordset("Fname") & " " & objRecordset("Lname")
Session("UserLoggedIn") = true
Session("User_ID") = strUserID
Session("Login_Name") = ""
objConnection.Close
Set objRecordset = Nothing
LoginUser (strUserID)
Session("Session_Message") = "Welcome " & Session("User_Name")
Session("paid") = 0
'Envoyons un courriel/Let's send the email
dim htmlmessage
dim strSiteURL
strSiteURL = "http://www.mywebsiteurl.com/"
htmlmessage = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.01 Transitional//EN"">"
htmlmessage = htmlmessage & "<html><head><title>"
htmlmessage = htmlmessage & "Nouveau candidat</title>"
htmlmessage = htmlmessage & "<style type=""text/css"">"
htmlmessage = htmlmessage & "<!--"
htmlmessage = htmlmessage & "Body {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px}"
htmlmessage = htmlmessage & "TD {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px}"
htmlmessage = htmlmessage & "-->"
htmlmessage = htmlmessage & "</style>"
htmlmessage = htmlmessage & "<META HTTP-EQUIV=""Content-Type"" Content=""text-html; charset=Windows-1252"">"
htmlmessage = htmlmessage & "</head>"
htmlmessage = htmlmessage & "<body topmargin=""5"" leftmargin=""5"" bgcolor=""#FFFFFF"" text=""#000000"">"
htmlmessage = htmlmessage & "<b>mywebsiteurl.com</b><hr>"
htmlmessage = htmlmessage & "Welcome to mywebsiteurl.com. Your new account is setup.<hr>"
htmlmessage = htmlmessage & "<table width=""50%"" border=""0"" cellspacing=""0"" cellpadding=""1"">"
htmlmessage = htmlmessage & "<tr>"
htmlmessage = htmlmessage & "<td><b>Email Address: </b>" & strEmail &"</td>"
htmlmessage = htmlmessage & "</tr>"
htmlmessage = htmlmessage & "<tr>"
htmlmessage = htmlmessage & "<td><b>Your Password: </b>"& strPassword &"</td>"
htmlmessage = htmlmessage & "</tr></table>"
htmlmessage = htmlmessage & "<P><a href=""http://" & strSiteURL & """>" & strSiteURL & "</a></P>"
htmlmessage = htmlmessage & "</body></html>"
CDOSendEmail2 htmlmessage, strEmail
Response.Redirect("http://mywebsiteurl/checkemail.html")
If Session("UserLoggedIn") = true Then
Response.Redirect("../candidate/default.asp")
End If
Next
Else If action = 2 Then
Dim strSQL
Set objConnection = Server.CreateObject("ADODB.Connection")
Set objRecordset = Server.CreateObject("ADODB.Recordset")
objConnection.Open Application("ConnectionString")
strSQL = "UPDATE Users SET " & _
"Fname = '" & Replace(Request.Form("firstname"), "'", "''") & "', " & _
"Lname = '" & Replace(Request.Form("lastname"), "'", "''") & "', " & _
"Address = '" & Replace(Request.Form("address"), "'", "''") & "', " & _
"City = '" & Replace(Request.Form("city"), "'", "''") & "', " & _
"Zip = '" & Replace(Request.Form("zip"), "'", "''") & "', " & _
"Country = '" & Replace(Request.Form("country"), "'", "''") & "', " & _
"UsrPassword = '" & Replace(Request.Form("password"), "'", "''") & "', " & _
"CareerLevel = '" & Replace(Request.Form("careerlevel"), "'", "''") & "', " & _
"unionaff = '" & Replace(Request.Form("union"), "'", "''") & "', " & _
"malefemale = '" & Replace(Request.Form("malefemale"), "'", "''") & "', " & _
"experience = '" & Replace(Request.Form("experience"), "'", "''") & "', " & _
"NewsLetter = '" & Cint(Request.Form("newsletter")) & "' " & _
"WHERE UserID = " & session("User_ID") & ""
'Response.write strSQL
'Response.end
' Use the execute method of the connection object the insert the record
objConnection.execute(strSQL)
objConnection.close
set objConnection = nothing
' Confirmation message
Session("Session_Message") = Replace(Session("User_Name"), "''", "'") & " your personal information has been updated."
Response.Redirect "../candidate/default.asp"
END IF
Sub LoginUser (strUserID)
Dim objConnection, objRecordset, SQLs
Set objConnection = Server.CreateObject("ADODB.Connection")
Set objRecordset = Server.CreateObject("ADODB.Recordset")
objConnection.Open Application("ConnectionString")
SQLs=""
SQLs= "SELECT UserID, Email, Fname, Lname, UserType FROM Users WHERE UserID = " & strUserID & ""
Set objRecordset=objConnection.Execute(SQLs)
Session("User_ID") = objRecordset("UserID")
Session("User_Type") = objRecordset("UserType")
Session("User_Name") = Replace(objRecordset("Fname"), "''", "'") & " " & Replace(objRecordset("Lname"), "''", "'")
Session("Login_Name") = objRecordset("Email")
Session("UserLoggedIn") = true
objConnection.Close
Set objRecordset = Nothing
End Sub
Sub CDOSendEmail2(MessageBody, SendTo)
Dim NewMail, objConfig, bSuccess, strErr
bSuccess = False
Set NewMail = Server.CreateObject("CDO.Message")
Set objConfig = Server.CreateObject("CDO.Configuration")
Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSMTPServer = "http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort = "http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPAuthenticate = "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoSendUsingPort = 2 'Must use this to use Delivery Notification
Const cdoAnonymous = 0
Const cdoBasic = 1 ' clear text
dim strMailServer
dim strMailServerPort
dim strFromEmail
strMailServer = "relay-hosting.secureserver.net"
strMailServerPort = 25
strFromEmail = "info@mywebsiteurl.com"
'Configuration:
objConfig.Fields(cdoSendUsingMethod) = cdoSendUsingPort
objConfig.Fields(cdoSMTPServer) = strMailServer ' value from DB
objConfig.Fields(cdoSMTPServerPort) = strMailServerPort
objConfig.Fields(cdoSMTPAuthenticate) = cdoAnonymous
'Update configuration
objConfig.Fields.Update
Set NewMail.Configuration = objConfig
NewMail.To = "<" & SendTo & ">" ' value passed from Form
NewMail.From = strFromEmail ' value of From Admin of site from DB
NewMail.Subject = strSubject
NewMail.HTMLBody = MessageBody
On Error Resume Next ' catch errors
NewMail.Send
If Err <> 0 Then ' error occurred
strErr = Err.Description
else
bSuccess = True
End If
if bSuccess = False Then
Response.Write("Error sending mail to " + SendTo + ", message: " + strErr)
Session("Session_Message") = Session("Session_Message") + "<br /> Error sending mail to " + SendTo + ", message: " + strErr + "<br />"
end if
Set NewMail = Nothing
Set objConfig = Nothing
End Sub
End if
%>
La patience est 50% d'un projet web réussi!