Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Community Discussions (All other subjects)
 ASP code needed (mailform)
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 11 May 2005 :  08:16:56  Show Profile
Does anyone have or know where to find an ASP code for a simple mailform, which has the feature to autoreply the sender ?

Thanks a lot.

Podge
Support Moderator

Ireland
3775 Posts

Posted - 11 May 2005 :  08:48:24  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Do you want to automatically send a copy of it to the sender? Or just set the reply-to address to the senders for the email the form sends you?

If this doesn't do it already, it should be easy to customise - http://www.pd9soft.com/aspformmail/index.asp

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 11 May 2005 :  08:55:33  Show Profile  Send StephenD a Yahoo! Message
I've good one here somewhere that runs a check for a valid email address too. I'll try and dig it out.
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 11 May 2005 :  09:05:30  Show Profile
Yeah, I need both:

1. Set the reply to sender adresse.
2. Automatically send a thank you mail to the sender.

I need the entire code please, I can hardly write response.write correctly.
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 11 May 2005 :  09:08:34  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
You can download it on that page - http://www.pd9soft.com/aspformmail/aspFormMailv2.31.zip

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 11 May 2005 :  09:11:15  Show Profile
I did, but it doesn´t seem to support automatic thank you mail.
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 11 May 2005 :  09:17:23  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
I wasn't sure exactly what you needed initially. It should be easy enough to add.
Which email component are you using ?

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

pdrg
Support Moderator

United Kingdom
2897 Posts

Posted - 11 May 2005 :  09:19:33  Show Profile  Send pdrg a Yahoo! Message
Ahhhh - in that case what you're trying to do is something pretty different - you need to watch a mailbox (pop3, probably, for INCOMING emails) and send a response on arrival of an email. ASP is a technology to run scripts when a WEB PAGE is requested, and sends an email with SMTP (outgoing emails)

You need a service running to poll the mailbox and send the thankyou emails when it finds incoming email.
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 11 May 2005 :  09:24:18  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Could the thank you email not be sent to the visitor when its sent to wii? i.e. the form sends two emails whenever it gets submitted one to wii and one to the visitor.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 11 May 2005 :  09:27:56  Show Profile
Ay, I've done something similar on ocassion, it shouldn't be too difficult to add it to the PD9 script.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 11 May 2005 :  10:14:07  Show Profile
I was looking at the code for PD9 script, and it seems very extensive compared to the simple script I use now, would it be possible to add the 2 features to this? Most important would be "1. Set the reply to sender adress."

<%
smtp_server_address = "websmtp.XXX"
on error resume next
Response.Buffer = True
Set Jmail = Server.CreateOBject( "JMail.Message" )
Jmail.Logging = true
Jmail.Silent = true
JMail.From = "from@mail.dk"
Jmail.AddRecipient "to@mail.dk"
JMail.Subject = "Message from this site"
FOR EACH el IN Request.Form
body = body & el & ": " & Request.form(el) & vbcrlf
NEXT
JMail.Body = Body
JMail.Priority = 1
if not Jmail.Send(smtp_server_address) then
' There was an error - print the error log
Response.write ("Error:<br>" & Jmail.log)
else
' The message has been sent - redirect to confirmation page
Set JMail = Nothing
response.redirect "redirect.asp"
end if
Set JMail = Nothing
%>
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 11 May 2005 :  10:37:25  Show Profile  Visit MarcelG's Homepage
For the ReplyTo part, you can just add a line:
JMail.ReplyTo = "replyto@address"

More tips for JMail: http://www.webmage.com/support/jmail.asp#ReplyTo

If you want to automatically sent the 'thank you' mail, I'd put it in there right after sending the first mail, e.g. something like this:
<% 
' Sending the email
JMail.Sender = "wii@mail.dk"
JMail.Subject = "Thank you!" 
' Get the recipients mailbox from a form (note the lack of a equal sign). 
JMail.AddRecipient Request.Form("from")
JMail.Body = "Thank you for sending your e-mail"
' Send it...
JMail.Execute 
%>

If I'm not mistaking this should work quite allright. I haven't got the JMail component available here, so I cannot try it.

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 12 May 2005 :  06:41:11  Show Profile
JMail.ReplyTo = "replyto@address"

But it needs to take the email adress from the form ?

I´ve tried the thank you mail code, but it didn´t work.

Help is appreciated, I wouldn´t even pay someone to do this for me, as a client of mine needs this.

Thanks a lot.
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 12 May 2005 :  08:19:18  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
JMail.ReplyTo = strFromEmail


Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 12 May 2005 :  09:37:51  Show Profile
Nope sorry, check the mailform itself here (very simple, as I like it)

<FORM action=SendMail.asp method=post>
<P><STRONG><LABEL for=name>Name<BR></LABEL></STRONG><INPUT id=name maxLength=200 size=35 name=name> </P>
<P><LABEL for=email><STRONG>Email</STRONG><BR></LABEL><INPUT id=email maxLength=100 size=35 name=email></P>
<P><STRONG>Message<BR></STRONG><TEXTAREA id=msg name=msg rows=10 cols=35></TEXTAREA> </P>
<P><INPUT type=submit value="Send"></P></FORM>
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 12 May 2005 :  11:24:18  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
This part of aspformmail.asp takes the form field and sets it to a variable and checks the validity of the email address.

CheckEmail(Request("FromEmail"))
strFromEmail = Request("FromEmail")

If you use Request("FromEmail") as the reply to address and bypass the validity check the mail may not get sent or you may not be able to reply to it as it may be invalid.

You obviously need a form field called FromEmail in the form for this to work.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.

Edited by - Podge on 12 May 2005 11:25:33
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.45 seconds. Powered By: Snitz Forums 2000 Version 3.4.07