Forums

This topic is locked

wish me luck

Posted 05 Aug 2002 03:44:46
1
has voted
05 Aug 2002 03:44:46 Dave Clarke posted:
When i get the chance I am going to try and alter the way emails are handled on my site.
At the moment on the page i have a simple mailto which is fine but allows people to see the email address that they are writing to and so aids spammers.
What i am going to try and do is use a SEND EMAIL link which will take the email address from the db (not the page) and send it from the server (jmail) so that the sender does not get the recipients address.
Big job for small brain, so please wish me luck.<img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Replies

Replied 05 Aug 2002 09:39:26
05 Aug 2002 09:39:26 Owen Eastwick replied:
I think you are over-complicating this.

Set up a form on Page 1 to collect the user input, set the form action to Page 2.

Page 2, which has the send mail code and your E-mail address would be a Server Side only page, it contains only VBScript or JScript or whatever scripting language you are using, no HTML, so it would be porcessed entirely at the server, never displayed in the browser and therefore not exposing your E-mail address.



Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 05 Aug 2002 20:32:25
05 Aug 2002 20:32:25 Dave Clarke replied:
I don't think I made myself clear, the email would be in reply to a message posted on the site by another user so it this persons address that I want to keep secret, as there are 1000's of messages and 1000's of email adresses on the site I would need to retrieve the email address from the database.
Similar sort of thing that they use on here when you "Email Poster", the email comes from here not from whoever sent it.
It's then up to you if you want to answer or not and the sender of the email hasn't got your address.

Edited by - Davecl on 05 Aug 2002 20:33:44
Replied 05 Aug 2002 23:04:23
05 Aug 2002 23:04:23 Owen Eastwick replied:
Same thing applies, Set up a form to collect the input, set the form action to a code only, server side page something like:

&lt;%
varMessage = Request("txtMessage"
varUserNumber = Request("hidUserNumber" ' A UserNumber or ID that is used to retrieve the EmailAddress from the User Data table.

RECORDSET CODE TO RETRIEVE EMAIL ADDRESS (SELECT Email FROM UserData WHERE UserNumber = varUserNumber)

varEmailAddress = RecordsetName.Fields.Item("EmailAddress".Value

SEND MAIL CODE

Response.Redirect("MailSent.asp"
%&gt;

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 05 Aug 2002 23:07:24
05 Aug 2002 23:07:24 Dave Clarke replied:
thanks Owen, thats what i've done, just got to construct the jmail now (i think)

thanks again

Dave
Replied 06 Aug 2002 03:48:12
06 Aug 2002 03:48:12 Dave Clarke replied:
hi
so this is what ive got so far
the user finds a message he wants to respond to and clicks the link which takes him to a detail page with this form on

<b>&lt;form name="form1" method="post" action="mailform2.asp"
&lt;input type="hidden" name="messid" value="&lt;%= Request.QueryString("MessageID" %&gt;"&gt;
&lt;input type="text" name="emailaddy" size="50"&gt;
&lt;br&gt;
&lt;input type="submit" name="Submit" value="Send E-Mail"&gt;
&nbsp;&nbsp;
&lt;input type="button" name="Submit2" value=" Cancel " onClick="MM_goToURL('parent','messages.asp');return document.MM_returnValue"&gt;
&lt;/form&gt;
</b>

He puts his email address in and submits the form which takes him to the server side page that sends the email

<b>
yourmessage = rcrdsetMessageResponse.Fields.Item("Message".Value
from = request.querystring("emailaddy"
emailadd = rcrdsetMessageResponse.Fields.Item("YourEmailAddress".Value

if emailadd ="" or instr(emailadd,"@"=0 then response.redirect("messages.asp"


crlf=chr(13)+chr(10)
tab=chr(9)
tab2=chr(9)+chr(9)
tab3=chr(9)+chr(9)+chr(9)
tab4=chr(9)+chr(9)+chr(9)+chr(9)

Set JMail = Server.CreateObject("JMail.SMTPMail"
JMail.ClearRecipients
JMail.body = ""
JMail.ServerAddress = "server address"
JMail.Sender = " "
JMail.Subject = "Someone has responded to your message"
JMail.AddRecipient emailadd
JMail.Body = "Hello" & tab2 & "Someone has responded to your message" & tab2 & yourmessage+crlf+crlf & "Their E-Mail Address is"+crlf+crlf & emailaddy

JMail.Priority = 1
JMail.Execute</b>

does this look okay??
Replied 06 Aug 2002 18:04:37
06 Aug 2002 18:04:37 Dave Clarke replied:
thought i had it sorted but when i click to send the mail i get this error

Error Type:
jmail.SMTPMail (0x8000FFFF)
The message was undeliverable. All servers failed to receive the message
/newreunite/mailform2.asp, line 30


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)

Page:
POST 82 bytes to /newreunite/mailform2.asp

POST Data:
mailaddy= &emailaddy= &Submit=Send+E-Mail

Time:
06 August 2002, 17:01:27


More information:

the page that sends the mail has all the same settings as another one that works fine, so i cant see the problem.
help please

Dave
Replied 07 Aug 2002 00:17:51
07 Aug 2002 00:17:51 Jeremy Millar replied:
Davecl,
You should add the
Mail.ServerAddress = "127.0.0.1"
into your code.
IDC
Replied 07 Aug 2002 08:23:02
07 Aug 2002 08:23:02 Dave Clarke replied:
thanks idc but i've already got the server address in there.
got it sorted now any way (see next post)
Replied 07 Aug 2002 08:26:09
07 Aug 2002 08:26:09 Dave Clarke replied:
DUH!!!! me <img src=../images/dmxzone/forum/icon_smile_blush.gif border=0 align=middle>

Got it sorted, I was using Request.QueryString for a form that is posted, when I should have been using Request.Form.
Couldn't see the wood for the trees.

Dave
Replied 07 Aug 2002 11:18:19
07 Aug 2002 11:18:19 Matthijs Horsman replied:
If you wanna do it with an extension

Checkout the beta section There's an axtension, of good old George... works great.....

Matthijs
----------------
DWMX/W-XP-PRO/IIS/ASP-VB
www.chaps.nl
Replied 09 Aug 2002 12:18:58
09 Aug 2002 12:18:58 b w replied:

Reply to this topic