ASP dundas mailer question

R

Raphael Gluck

Hi all

I am still finding my feet creating a website in ASP, and i'm trying to get
to grips with users providing feeback to my site.
my webhosts have the dundas mailer installed, and i am trying to get it to
work for me.
does it work in conjuction with regular html? can i add a <form> and text
fields? and then will all that get sent with the page?
I have a little script but i dont know how to modify it

http://www.tripak.me.uk/dundas.txt
which when i am done with, must change to and .asp extension.
but where do i add it form content?
Say i want to ask the person viewing the page, to send me feedback, Just to
add a textfield, and some html asking for their name, how do i go about
that?

I hope someone can help me

thanks

Raphael
 
T

Tom B

Create a page with the appropriate fields you need to collect.

Post that form to the page you have (dundas.txt)
on the dundas.txt page, build the email up in a variable, and add it to the
objEmail.HTMLBody property. I assume there's also an objEmail.Body property
as well for those who don't use html.

So...For example
Page1.asp

<form method=post action=Dundas.asp>
<p>What's your name<input name=fname></p>
<p>What's your email address<input name=email></p>
<p><input type=submit value=Send></p>
</form>

Dundas.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%

Dim objEmail 'stores a Mailer control object
Dim strPath 'stores path to a directory we create at same level as this ASP
page


Set objEmail = Server.CreateObject("Dundas.Mailer") 'Mailer object

'specify the recipient of this message
objEmail.TOs.Add "yourATemailaddress.com"

'specify the subject of the email
objEmail.Subject = "Sent from the web page"

'specify the sender of the message
objEmail.FromAddress = Request.Form("email")

'specify an SMTP Relay server. This increases the speed and reliability of
the operation
objEmail.SMTPRelayServers.Add Request.Form("SMTP")


Dim sBody
sBody="The user's name is " & Request.Form("fname")


'initialize the HtmlBody property, we'll throw a header into it
objEmail.HTMLBody = "<Html><Head></Head><Body>" & sBody
objEmail.SendMail

%>
 
R

Raphael Gluck

First of all thank you very much for taking the time to reply, i really
appreciate it.

I thought it would work easy as pie, but i am having some teething problems.
I keep getting 500 internal server error when I try, a test form.
Aside from adding in the email address to the dundas asp script, I am not
clear, must I modify something else? to tell the dundas.asp page that the
previous page, page1.asp is trying to send via it;'s script?

Many thanks

Raphael
 
R

Raphael Gluck

Ok, i think i'm begining to understand, please forgive my ignorance but
I have to create a variable in the dundas.asp page

to collect the info from page1.asp

Dim sBody
sBody="The user's name is " & Request.Form("test")

assuming i called the form in page1.asp "test"

Then the line that actually calls up the variable is

'initialize the HtmlBody property, we'll throw a header into it
objEmail.HTMLBody = "<Html><Head></Head><Body>" & sBody

Is that correct? that's how my webhost put it out, did they miss a closing
</body> tag, by any chance?
 
R

Ray at

Do you really have a form field named (e-mail address removed)? Probably not.
If you're hard coding the e-mail address, just do

objEmail.TOs.Add "(e-mail address removed)"

And it's "TOs?" Interesting...

Ray at home
 
R

Raphael Gluck

I emailed my webhost today, and indeed there was problem with the script,
which they have now corrected so it works, it was the SMTP relay server line
that needed some numbers added to! but thank you Tom for the variable help.
And thank you ray, for showing me where to put my e-mail address


Raphael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top