469,635 Members | 2,395 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,635 developers. It's quick & easy.

ASP dundas mailer question

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
Jul 19 '05 #1
6 6851
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

%>

"Raphael Gluck" <iwish i could tell you @alas blame the spammers> wrote in
message news:O0**************@TK2MSFTNGP12.phx.gbl...
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

Jul 19 '05 #2
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
Jul 19 '05 #3
First find out what the error is so you can figure out how to correct it.
http://www.aspfaq.com/2109

Ray at home

--
Will trade ASP help for SQL Server help
"Raphael Gluck" <iwish i could tell you @alas blame the spammers> wrote in
message news:OL**************@tk2msftngp13.phx.gbl...
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

Jul 19 '05 #4
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?
Jul 19 '05 #5
Do you really have a form field named tr****@tripak.me.uk? Probably not.
If you're hard coding the e-mail address, just do

objEmail.TOs.Add "tr****@tripak.me.uk"

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

Ray at home
--
Will trade ASP help for SQL Server help
"Raphael Gluck" <iwish i could tell you @alas blame the spammers> wrote in
message news:eO**************@TK2MSFTNGP09.phx.gbl...
Ah, clever never knew that, Thanks for that tip. I have IE 6 and still got
that error 500
DSMailer.Address.1 error '80004005'

Address can not be empty string.

/dundas.asp, line 11

Is what is should have said, but now how to go about correcting it, my line 11. in dundas.asp reads

objEmail.TOs.Add Request.Form("tr****@tripak.me.uk")

Is that wrong? or am a quoting the wrong line 11?

thanks

Jul 19 '05 #6
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
Jul 19 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by John Davis | last post: by
1 post views Thread by Hans [DiaGraphIT] | last post: by
1 post views Thread by Beyza | last post: by
4 posts views Thread by =?Utf-8?B?TWlrZSBI?= | last post: by
4 posts views Thread by Al G | last post: by
8 posts views Thread by dancer | last post: by
6 posts views Thread by Dave Kelly | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.