Hi all,
I want to set up an application form where the user can send an attachment by email.
For some reason code doesn't function right. I get Internal Server Error - page cannot be displayed. Any ideas??
Here is my code:
PHP Code:<%
Dim objMail
Dim MyBody
Dim MyCDONTSMail
dim name
dim email
dim current_position
dim position_applied
dim education
dim salary
dim availability
dim address1
dim address2
dim country
dim phone
dim cv
dim comments
dim submitted
submitted=Request.Form("submitted")
name=Request.Form("name")
email=Request.Form("email")
current_position=Request.Form("current_position")
position_applied=Request.Form("position_applied")
education=Request.Form("education")
salary=Request.Form("salary")
availability=Request.Form("availability")
comments=Request.Form("comments")
address1=Request.Form("address1")
address2=Request.Form("address2")
country=Request.Form("country")
phone=Request.Form("phone")
cv=Request.Form("Fileatt")
If submitted<>"true" Then
%>
<p>You did not press submit!</p>
<%
Else
If (name = "" or email = "") Then
%>
<p>Please enter your name and email</p>
<p><a href="#" onClick="history.go(-1)">Return</a></p><br />
<%
Else
If country = "" Then
%>
<p>Please enter your Country</p>
<p><a href="#" onClick="history.go(-1)">Return</a></p><br />
<%
Else
If (current_position = "" or position_applied = "") Then
%>
<p>Please enter your current Position</p>
<p><a href="#" onClick="history.go(-1)">Return</a></p><br />
<%
Else
If education = "" Then
%>
<p>Please enter your education</p>
<p><a href="#" onClick="history.go(-1)">Return</a></p><br />
<%
Else
If salary = "" Then
%>
<p>Please enter your Salary</p>
<p><a href="#" onClick="history.go(-1)">Return</a></p><br />
<%
Else
If availability = "" Then
%>
<p>Please enter your date of availability</p>
<p><a href="#" onClick="history.go(-1)">Return</a></p><br />
<%
Else
If phone = "" Then
%>
<p>Please enter your Phone number</p>
<p><a href="#" onClick="history.go(-1)">Return</a></p><br />
<%
Else
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = email
objMail.Subject = "Job Application Form"
objMail.To = "kevin.o'brien@pfpc.ie"
MyCDONTSMail.Attachfile = cv
MyBody = "Name: " & name & vbCrLf
MyBody = MyBody & "Email: " & email & VbCrLf
MyBody = MyBody & "Address: " & address1 & VbCrLf
MyBody = MyBody & "Address2: " & address2 & VbCrLf
MyBody = MyBody & "Country: " & country & VbCrLf
MyBody = MyBody & "Phone: " & phone & VbCrLf
MyBody = MyBody & "Education: " & education & VbCrLf
MyBody = MyBody & "Current Position: " & current_position & VbCrLf
MyBody = MyBody & "Position Applied For: " & position_applied & VbCrLf
MyBody = MyBody & "Salary Expectations: " & salary & VbCrLf
MyBody = MyBody & "Availability: " & availability & VbCrLf
MyBody = MyBody & "Comments: " & VbCrLf & comments & VbCrLf
MyCDONTSMail.Body= MyBody
MyCDONTSMail.Send
set objMail = nothing
%>
<p>Thank You <% Response.Write(name) %>Your application has been submitted.</p>
<%
End If
End If
End If
End If
End If
End If
End If
End If
%>




Bookmarks