I think you need test your code in two parts: the data you saved into
the DB tables,and your mail server. If I were you, I would use the
second part of your code(from create CDONTS.newmail)
give static mail factors, such us oMail.from =3D webmaster@m...,
oMail.to =3D myBox@m...
oMail.Body =3D "Test mailserver", oMail.Subject =3D "test test"
then oMail.send to see if your smtp server works ok or not.
Then retrieve your real data from table, add one at a time to see if
your data crush your mail delivery.
Thanks.
Minny Guo
-----Original Message-----
From: Reza Nader [mailto:rnaderpo@y...]
Sent: Monday, July 15, 2002 8:38 AM
To: IIS_Applictaions
Subject: [iis_applications] Email Problem
I have written a code to send email from this application and it worked.
But now, for some reason, it doesn't send email anymore. Can someone
help
please?
Thank you,
HERE IS THE CODE:
<%
Response.Buffer =3D True
Dim con, rst, sql, intTickNum, objMail
Const adOpenKeyset =3D 1
Const adLockOptimistic =3D 3
'Open database
Set con =3D Server.CreateObject("ADODB.Connection")
con.Open "DSN=3Dsrs;UID=3Dsrs;PWD=3Dsrs;"
set rst =3D server.createObject("adodb.recordset")
'Insert form info
sql =3D "Insert into srstable (fname,lname,email,pcatagory,pdescription)
"
sql =3D sql & "values ('" & Request.Form("FNAME") & "','" &
CStr(Request.Form
("LNAME")) & "','"
sql =3D sql & CStr(Request.Form("EMAIL")) & "','" & CStr(Request.Form
("PCATAGORY")) & "','"
sql =3D sql & CStr(Request.Form("PDESCRIPTION")) & "')"
rst.Open sql, con
sql =3D ""
'Retrieve ticket number
'sql =3D "Select max (ticketnumber) from srstable"
sql =3D "Select * from srstable order by ticketnumber desc"
rst.Open sql, con
intTickNum =3D rst("TICKETNUMBER")
rst.Close
con.close
'Create email
Set objMail =3D Server.CreateObject("CDONTS.NewMail")
=09
objMail.From =3D Request.Form("EMAIL")
objMail.BodyFormat =3D cdoBodyFormatHTML
objMail.MailFormat =3D cdoMailFormaMIME
objMail.To =3D "rnaderpo@y..."
objMail.Subject =3D Request.Form("PCATAGORY") & " #" & intTickNum
objMail.Body =3D "To view this request follow this link:<BR><a
href=3Dedit_ticket.asp?ticketnumber=3D" & intTickNum &
">edit_ticket.asp?
ticketnumber=3D" & intTickNum & "</a>"
'Send email
objMail.Send
'Show thank you
Response.Write "Thank you for submitting your problem.<BR>"
Response.Write "Your ticket number is: " & intTickNum & ".<BR>"
Response.Write "Please make a note of it."
%>