Forum Moderators: open

Message Too Old, No Replies

JMail form problems

         

GoSox

5:07 pm on Oct 26, 2004 (gmt 0)



Been trying to set up an online web form that sends emails with the users personal info. Simple enough right? Apparently not. I don't get any errors when I debug, when I test it tells me the message has been sent successfully, but no email. Code...
<%
Dim name
Dim maiden
Dim address
Dim city
Dim province
Dim postal_code
Dim email
Dim telephone
Dim employer
Dim program
Dim campus
Dim year_grad
Dim stud_number
Dim spouse
Dim spouse_name
Dim spouse_program_campus_year
Dim rbAlumni
Dim cbEnter
Dim recip
Dim subject
Dim Body

name = Trim(request.form("name"))
maiden = Trim(request.form("maiden"))
address = Trim(request.form("address"))
city = Trim(request.form("city"))
province = Trim(request.form("province"))
postal_code = Trim(request.form("postal_code"))
email = Trim(request.form("email"))
telephone = Trim(request.form("telephone"))
employer = Trim(request.form("employer"))
program = Trim(request.form("program"))
campus = Trim(request.form("campus"))
year_grad = Trim(request.form("year_grad"))
stud_number = Trim(request.form("stud_number"))
spouse = Trim(request.form("spouse"))
spouse_name = Trim(request.form("spouse_name"))
spouse_program_campus_year = Trim(request.form("spouse_program_campus_year"))
rbAlumni = Trim(request.form("rbAlumni"))
cbEnter = Trim(request.form("cbEnter"))
recip = "johndoe@home"
thesubject = "Send this"

Dim Body
Body = Body & "Name: " & vbCrLf
Body = Body & "maiden: " & vbCrLf
Body = Body & "adress: " & vbCrLf
Body = Body & "city: " & vbCrLf
Body = Body & "province " & vbCrLf
Body = Body & "postal_code " & vbCrLf
Body = Body & "email " & vbCrLf
Body = Body & "telephone " & vbCrLf
Body = Body & "employer " & vbCrLf
Body = Body & "program " & vbCrLf
Body = Body & "campus " & vbCrLf
Body = Body & "year_grad " & vbCrLf
Body = Body & "stud_num " & vbCrLf
Body = Body & "spouse " & vbCrLf
Body = Body & "spouse_name " & vbCrLf
Body = Body & "spouse_program_campus_year " & vbCrLf
Body = Body & "rbAlumni " & vbCrLf
Body = Body & "cbEnter " & vbCrLf

Dim jmail
Set JMail = Server.CreateObject("jmail.SMTPMail")
JMail.ServerAddress = "$%$#$%#$%"
JMail.Sender = email
JMail.Subject = subject
JMail.Body = Body
JMail.AddRecipient Recip
JMail.Priority = 3

' Send it...
JMail.Execute

JMail.close

%>

MozMan

10:01 pm on Oct 27, 2004 (gmt 0)

10+ Year Member



Hard to say for sure, but here are some things I would look at, and verify that they are correct:

1- on this line:

JMail.ServerAddress = "$%$#$%#$%"

Make sure you have a valid SMTP server here, and that it is running.

2- on this line:

JMail.AddRecipient Recip

Make sure the email address contained in Recip is valid, and has not been over-written by the time this happens.

3- (also same line as 2:)

JMail.AddRecipient Recip

Double check the sytax here. All of the other jmail params you set using an equal sign, but this one you did not. Should it look like this:
JMail.AddRecipient = Recip

?

hth

-Moz