DotDragnet
May 24, 2012, 09:17:20 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Mobile users - Our forum is Tapatalk enabled. http://www.tapatalk.com/
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Redirecting form emails in pre-existng site  (Read 266 times)
Haze
Hero Member
*****
Posts: 1485



View Profile Awards
« on: January 04, 2012, 02:56:43 PM »

HI All

I have been asked by my Agent (for my acting and associated work) if I ould make sme changes to his site as the originl designer is no longer available. The pages have .asp file extensons, I've looked through the source code and can only find the code below which looks as though it sends form results. If I changes the "To" email address to my own then the form result still seems to go to his old email address. Anyone got any suggestions?

Code:
<%
Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.From = "website@CLIENT.co.uk"
objCDO.To = "RECEIVING EMAIL ADDRESS removed"
objCDO.Subject = "Callback request from " + frmName
objCDO.Body = "From: " + frmName + vbcrlf + "Email: " + frmCompany + vbcrlf + "Tel: " + frmTel + vbcrlf + vbcrlf + "Comments: " + vbcrlf + frmComments
objCDO.BodyFormat = 1
objCDO.MailFormat = 1
objCDO.Send
set objCDO=nothing
%>
« Last Edit: January 04, 2012, 02:58:33 PM by Haze » Logged
spannaa
Full Member
***
Posts: 214



Spannaa
View Profile WWW Awards
« Reply #1 on: January 04, 2012, 04:11:43 PM »

Yep, it's an old classic asp cdonts form to email script and the line:

Code:
objCDO.To = "RECEIVING EMAIL ADDRESS removed"

Is where the email should be sent to.

If it's still being sent to his old email address then there must be some other code doing this.

Logged
Dom
Hero Member
*****
Posts: 1681


Taster of pasities. Clanger of both pots AND pans.


DominicNeagle
View Profile Awards
« Reply #2 on: January 04, 2012, 04:56:54 PM »

Or perhaps there's some kind of forwarding thing set up, so that all email that get sent from that particular system always get copied to his old email address, regardless of who they're actually sent to.

Probably unlikely, but I thought I'd throw the suggestion in the mix.
Logged

Haze
Hero Member
*****
Posts: 1485



View Profile Awards
« Reply #3 on: January 04, 2012, 05:51:40 PM »

I removed the email address from within the code. I tried insertin my own email address, but it would seem that messages are still sent to my Agent's ntl emil address. As mentioned there must be something else forwarding the emails too. Incidentally adding my own email address results in no message to my email address, and the client says he gets the email. I'll need to confirm that too as he can be a bit vague. This is what is present in here code prior to the head region
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
If Request("action") = "add" then

Dim DataConn
Dim CmdUpdateRecord
Dim MYSQL
Dim rs

Set DataConn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")

DataConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=e:/domains/r/clientsite.co.uk/user/private/clientid89.mdb"

rs.Open "callbacks", DataConn, 1, 3

rs.AddNew
%>

<% If NOT Request.Form("name") = "" Then %><% rs("name") = Request.Form("name") %><% End If %><%=Request.Form("name")%>
<% If NOT Request.Form("company") = "" Then %><% rs("company") = Request.Form("company") %><% End If %><%=Request.Form("company")%>
<% If NOT Request.Form("telephone") = "" Then %><% rs("telephone") = Request.Form("telephone") %><% End If %><%=Request.Form("telephone")%>
<% If NOT Request.Form("comments") = "" Then %><% rs("comments") = Request.Form("comments") %><% End If %><%=Request.Form("comments")%>

<%
rs.Update
%>

<%
Dim frmName, frmCompany, frmSubject, frmComments

frmName=request.form("name")
frmCompany=request.form("company")
frmTel=request.form("telephone")
frmComments=request.form("Comments")
%>
<%
Dim objCDO
Set objCDO = Server.CreateObject("CDONTS.NewMail")
objCDO.From = "website@client site domain.co.uk"
objCDO.To = "addedmytestemailaddress"
objCDO.Subject = "Callback request from " + frmName
objCDO.Body = "From: " + frmName + vbcrlf + "Email: " + frmCompany + vbcrlf + "Tel: " + frmTel + vbcrlf + vbcrlf + "Comments: " + vbcrlf + frmComments
objCDO.BodyFormat = 1
objCDO.MailFormat = 1
objCDO.Send
set objCDO=nothing
%>
<%
Response.Redirect("callbackform.asp?action=thanks")

End If
%>
I altered the original callbackform by changing company to email as he wanted enquirers' email addresses rather than company details, and whilt it all sends message details back ok, I don't seem able to get the email address option changed....
« Last Edit: January 04, 2012, 06:44:24 PM by Haze » Logged
Haze
Hero Member
*****
Posts: 1485



View Profile Awards
« Reply #4 on: January 05, 2012, 10:04:16 PM »

Tried changing the form receiver's email address to one on the same server as the form, but still the form results were sent to the ntlworld email address. So, as has been mentioned earlier, there must be something else controlling where the form results are sent.
Logged
sarahA
DDN Contribs
Hero Member
*****
Posts: 2184



View Profile WWW Awards
« Reply #5 on: January 06, 2012, 12:27:05 PM »

have you checked via the web where the form is submitted to? Is it the file you posted above? Sounds to me like you've got the wrong file.
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2008, Simple Machines Valid XHTML 1.0! Valid CSS!