Blelisa
12-12-2006, 10:44 AM
Hello everyone, and happy holidays!
I have a form that my users fill out to schedule a service call. When they click on submit it enters the info in to my database and then I would like it to send me an email containing the info that my user filled out so I can enter the service order for my technicians.
I had it all figured out with CDONTS but I recently changed to a new web hoster and they need it done in JMAIL. Now I cannot get it to work.
Below is the code I have tried with, I have adapted it to just send me an email, I have not gotten into trying to input the form results in it yet. I figure first get it working. I have not received any error message however it does not send me an email.
<%
set connection=Server.CreateObject("ADODB.Connection")
connection.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &_
server.MapPath("data/svc.mdb")
connection.Open
sql="INSERT INTO [svcrequ] ([company], [address], [contact], [phone], [city], [email], [make], [Team], [details], [maint], [nomaint], [txtDate], [am], [pm])"
sql=sql & "VALUES"
sql=sql & "('" & Session("company") & "',"
sql=sql & "'" & Session("address") & "',"
sql=sql & "'" & Session("contact") & "',"
sql=sql & "'" & Session("phone") & "',"
sql=sql & "'" & Session("city") & "',"
sql=sql & "'" & Session("email") & "',"
sql=sql & "'" & Request.Form("make") & "',"
sql=sql & "'" & Request.Form("Team") & "',"
sql=sql & "'" & Request.Form("details") & "',"
sql=sql & "'" & Request.Form("maint") & "',"
sql=sql & "'" & Request.Form("nomaint") & "',"
sql=sql & "'" & Request.Form("txtDate") & "',"
sql=sql & "'" & Request.Form("am") & "',"
sql=sql & "'" & Request.Form("pm") & "')"
connection.Execute(sql)
DIM strcompany, strcontact, stremail, strmake, strTeam, strdetails, strmaint, strnomaint, strtstDate, stram, strpm
strcompany = Request.Form("company")
strcontact = Request.Form("contact")
stremail = Request.Form("email")
strmake = Request.Form("make")
strTeam = Request.Form("Team")
strdetails = Request.Form("details")
strmaint = Request.Form("maint")
strnomaint = Request.Form("nomaint")
strtstDate = Request.Form("txtDate")
stram = Request.Form("am")
strpm = Request.Form("pm")
Set JMAil = Server.CreateObject("JMail.SMTPMAil")
JMAil.ServerAddress = "mail.hemisphere.net"
JMail.AddRecipient "lblendowski@hemisphere.net"
JMAil.Sender = stremail
JMail.Body = strcompany
JMAil.Execute
Set JMAil=Nothing
if err<>0 then
Response.Write(Err.Description)
else
response.redirect("tyreg.html")
end if
connection.close
%>
Thanks in advance for any help you can give!
I have a form that my users fill out to schedule a service call. When they click on submit it enters the info in to my database and then I would like it to send me an email containing the info that my user filled out so I can enter the service order for my technicians.
I had it all figured out with CDONTS but I recently changed to a new web hoster and they need it done in JMAIL. Now I cannot get it to work.
Below is the code I have tried with, I have adapted it to just send me an email, I have not gotten into trying to input the form results in it yet. I figure first get it working. I have not received any error message however it does not send me an email.
<%
set connection=Server.CreateObject("ADODB.Connection")
connection.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &_
server.MapPath("data/svc.mdb")
connection.Open
sql="INSERT INTO [svcrequ] ([company], [address], [contact], [phone], [city], [email], [make], [Team], [details], [maint], [nomaint], [txtDate], [am], [pm])"
sql=sql & "VALUES"
sql=sql & "('" & Session("company") & "',"
sql=sql & "'" & Session("address") & "',"
sql=sql & "'" & Session("contact") & "',"
sql=sql & "'" & Session("phone") & "',"
sql=sql & "'" & Session("city") & "',"
sql=sql & "'" & Session("email") & "',"
sql=sql & "'" & Request.Form("make") & "',"
sql=sql & "'" & Request.Form("Team") & "',"
sql=sql & "'" & Request.Form("details") & "',"
sql=sql & "'" & Request.Form("maint") & "',"
sql=sql & "'" & Request.Form("nomaint") & "',"
sql=sql & "'" & Request.Form("txtDate") & "',"
sql=sql & "'" & Request.Form("am") & "',"
sql=sql & "'" & Request.Form("pm") & "')"
connection.Execute(sql)
DIM strcompany, strcontact, stremail, strmake, strTeam, strdetails, strmaint, strnomaint, strtstDate, stram, strpm
strcompany = Request.Form("company")
strcontact = Request.Form("contact")
stremail = Request.Form("email")
strmake = Request.Form("make")
strTeam = Request.Form("Team")
strdetails = Request.Form("details")
strmaint = Request.Form("maint")
strnomaint = Request.Form("nomaint")
strtstDate = Request.Form("txtDate")
stram = Request.Form("am")
strpm = Request.Form("pm")
Set JMAil = Server.CreateObject("JMail.SMTPMAil")
JMAil.ServerAddress = "mail.hemisphere.net"
JMail.AddRecipient "lblendowski@hemisphere.net"
JMAil.Sender = stremail
JMail.Body = strcompany
JMAil.Execute
Set JMAil=Nothing
if err<>0 then
Response.Write(Err.Description)
else
response.redirect("tyreg.html")
end if
connection.close
%>
Thanks in advance for any help you can give!