Click to See Complete Forum and Search --> : Mailto: masking email addresses
midge
06-10-2005, 09:54 AM
Hi,
Im currently developing a form which allows users to make comments anonamously and are then emailed out to a particular user but im not sure how to mask out the From address in the email field. Ive got this code so far:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form action="mailto:midgetron@hotmail.com?from=anon@eaga.co.uk" " method ="post" enctype="text/plain">
<center><p>Please enter entry text:</p><br></center>
<center><TEXTAREA ROWS="15" NAME="text" COLS="50"></TEXTAREA><br></center>
<center><INPUT TYPE="submit" VALUE="Submit" NAME="B1"><input type="reset" value="Reset"></center>
</form>
</body>
</html>
any help with this would be great.
midge
06-10-2005, 10:25 AM
I started using CDONTS but it just doesnt seem to be working to fix the problem : s
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<%
If Request.Form("B1") = "Submit" Then
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "email@email.com"
objMail.Subject = "Staff Council Email"
objMail.To = "midgetron@hotmail.com"
objMail.Body = request.form("Email")
objMail.Send
'You should always do this with CDONTS.
set objMail = nothing
End If
%>
<form method="post">
<b>Enter your comment:</b><br>
<input type="text" name="Email">
<p>
<input type="submit" value="Submit" name="B1">
</form>
</body>
</html>
lmf232s
06-10-2005, 10:25 AM
well your going to have to supply a valid email address for the from field,
so use some generic email address for the from field, it does not have to be there
email address. If you want to copy the user that is sending this use the blind cc
or
bcc=lfaj32@hotmail.com
midge
06-10-2005, 11:40 AM
I altered my code to this though its still not working correctly and Im not really sure why.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
If IsEmpty(Request.Form("Email")) Then
%>
<html>
<body>
<form method="post">
<b>Enter your comment:</b><br>
<input type="text" name="Email">
<p>
<input type="submit" value="Submit" name="B1">
</form>
</body>
</html>
<%
Else
Dim objMail
Set objMail = Server.CreateObject("CDO.Message")
objMail.From = "WebPage"
objMail.Subject = "Staff Council Email"
objMail.To = "midgetron@hotmail.com"
objMail.Body = request.form("Email")
objMail.Send
'You should always do this with CDONTS.
set objMail = nothing
%>
<html>
<body>
<p>Thanks for filling in the form.
It has been forwarded to the appropriate person.</p>
</body>
</html>
<%
End If
%>
lmf232s
06-10-2005, 01:36 PM
the from address needs to be a valid email address, it does not have to exist but your server will not send it or accept it if it looks bogus. This is to help stop spam. Change the From field to be something like this
WebPage@domainname.com
yes what wmif said, i was going to type my domain name when i type the bogus address but put @info.com which would not send from my server as it
would weed it out. Dont know why i put @info.com, oh well.
just to add a bit to lmf's info. also make sure that the domain name for your dummy from address is valid. some smtp servers will do a dns check for a ptr record to make sure that the domain is valid.