VBS in ASP

F

Fox

Can anyone tell me why I might be getting a 500 error
trying to use this VBS template in ASP? The only thing
I could see to do to make it work in ASP was to
add Server.CreateObject instead of CreateObject.
But, obviously there is something more. Are the WITH
statements ok or do they need to be changed ?

Dim iMsg
Dim iConf
Dim Flds
Dim strHTML

Const cdoSendUsingPickup = 1

set iMsg = Server.CreateObject("CDO.Message")
set iConf = Server.CreateObject("CDO.Configuration")

Set Flds = iConf.Fields
With Flds
.Item("sendusing") = cdoSendUsingPickup
' TODO: Replace <PICKUP DIRECTORY> with path to your pickup directory
' Typically, c:\Inetpub\mailroot\pickup
.Item("smtpserverpickupdirectory")= "c:\Inetpub\mailroot\pickup"
.Update
End With

' Build HTML for message body.
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<b> This is the test HTML message body</b></br>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"

Dim iBP
With iMsg
Set .Configuration = iConf
.To = "(e-mail address removed)"
.From = "(e-mail address removed)"
.Subject = "This is a test CDOSYS message (Sent via Pickup)"
.HTMLBody = strHTML
'TODO: if adding an attachment,
'uncomment the next line and alter file path as required
'Set iBP = iMsg.AddAttachment(App.Path & "\file1.txt")
.Send
End With

' Clean up variables.
Set iBP = Nothing
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
 
F

Fox

http://www.aspfaq.com/show.asp?id=2109


Mike D said:



Hi,

I am already past the suggestions on that page.
My error configuration is what it needs to be to
show details in the server and in IE..

What I really need is for someone
to take a look to see why the template
works in VBS and not in ASP?.

The only thing I can come up with is
possibly the command "WITH".
Not knowing as much as many of you, I do not
know if "WITH" works in an ASP page as it does in
the VBS or does that need to be converted for ASP ?

Or is there another problem in this script?

thanks,
Fox
 
R

Ray at

Fox said:
I am already past the suggestions on that page.
My error configuration is what it needs to be to
show details in the server and in IE..

Okay, then what's the error? If you are already past the suggestion on that
page, you wouldn't see "500 Internal Server Error."

Ray at work
 
F

Fox

Sorry, I forgot I was on someone else's computer when I tested
it and saw the 500 error. My mistake, I humbly apologize.

Meanwhile, I noticed something and fixed it. I did not understand
the concept or word SCHEMAS. I used the Microsoft full
schemas paths and it works fine.

But why is this something to be called online. Weird !!!
I have the info on how to call it from my computer
using the METADATA TYPE and will try that next.
Is this to be entered in the same place in the script
as the SCHEMAS path was entered?

Fox
 
A

Aaron Bertrand - MVP

But why is this something to be called online. Weird !!!

It looks that way, but it is not. If you have a local SMTP server, unplug
your network cable and you'll see that the code still works, and that the
message gets to your pickup directory at least...
 
A

Aaron Bertrand - MVP

Maybe there was a reason.

The only reasons I know of for multi-posting are that a person is impatient
or thinks their question is so much more important than others that they are
excluded from observing etiquette.
Grow up !

No, learn to use the groups effectively. You're here to get help, right?
People that come here to help you are going to be unwilling to do so if you
ignore established etiquette, and give all kinds of attitude...
 
F

Fox

I've got like 5 different sample scripts (G)
I can get some to work but they will not suit the purpose.
I have freestanding "VBS only" and I have ASP with a form
built in. Ultimately I have to supply the TO field from SQL.
I am juggling these scripts and trying to find one that I can
alter and still have it work. Unfortunately, a lot depends on
having this done before the morning. I will keep trying.

What's up with Ray, does he always get so easily pieved?

Fox
 
R

Ray at

Fox said:
What's up with Ray, does he always get so easily pieved?
I think the FAQ does a pretty decent job explaining it. I couldn't have
said it better myself. It's not a problem with me if you want to decrease
your chances of getting help here. It was just a suggestion that I offered
so that you are more likely to find an answer.

Ray at work
 
F

Fox

You must be old enough to know that everything cannot
be known by a surface appearance. You have no idea
why I posted on two groups and you did not ask or wait to
find out. You were not being kind and informative, you
were taking advantage of someone who needs help and
instead talking an opportunity to have some fun at their
expense.

There are people who are nice and people who are not nice.
You can choose which one you want to be.

Fox
 
R

Ray at

In time, you will see that I was being the exact opposite of what you've
already chosen to believe. You're just new at this, and that is fine.
We've all been there.

Ray at work
 
B

Bob Barrows

Fox said:
You must be old enough to know that everything cannot
be known by a surface appearance. You have no idea
why I posted on two groups and you did not ask or wait to
find out. You were not being kind and informative, you
were taking advantage of someone who needs help and
instead talking an opportunity to have some fun at their
expense.

Here is an example of why we dsilike it when people multipost:
http://www.google.com/groups?hl=en&..._maxd=9&as_maxm=12&as_maxy=2003&start=20&sa=N


Let me ask you which of the following outcomes you would prefer:

A. You multipost a few times and initially get answers to your questions,
but then you realize that nobody is answering your questions or even giving
you an indication that they have read your questions.

or

B. Your initial multipost receives a response requesting you to refrain from
multiposting, so you stop multiposting and receive prompt answers on all
your future questions

I think if you reflect on it, you will realize that Ray was attempting to do
you a favor.

Bob Barrows
 
F

Fox

Might as well answer both of you at the same time.
First to Ray. I am not new at this, so I do not have that
excuse. I know what you did because I frequent other
NGs and I know the routine. Ray, you could have simply
stated something in 2 lines instead of sending me to a page
which tells me that someone is annoyed with me. That is not
defensibe as a favor. That is wasting my time and getting your
rocks off and you know it. Why did you go to back to the
other NG to read my next post? Having some fun there Ray;)

Bob, as for your defense of him, I think that you are well
intended but you should rethink Rays approach.

As for my double post, I was desparate and as soon as I got
a response on the one group, I ended the other and it was
before anyone had responded. I did not know which group to
post in and when you are desparately in a hurry, I think that
just might be defensible. I know what you are trying to tell me but
it was the manner that makes the difference. And that is the
reason for this note and also to get my own rocks off cause
I am very frustrated and cannot meet a deadline that is
very important.

In fact I still don't have what I need and this is serious.
I am trying to work it out myself instead of leaning on
others. Don't you think that some people are deserving
of a break and don't need insult added to them when they
are in a crisis. Can't we all just get along (that's embarassing ;)

As I said, you can choose which kind of
person you are. I think that Bob, your intent was to be positive
and I thank you for that. Ray, what you did was not really
a big deal, but it was childish. You are a grown-up and
I am guessing that you can write exactly what you want
to say when you want to help someone. So what you did
was obviously just a childish atttempt at getting your rocks
off.

Sorry to be so laborsome over trivia, but maybe I can
get some of my frustration off my chest and just maybe
Ray is reachable and can be self-effacing. Ray, I teach
my kids something that might reach you. I tell them that
even if they have to lie to others, never lie to your self.

Fox
 
B

Bob Barrows

Fox wrote:
<snip>
Last attempt.
We regulars take a huge part of our days answering very many questions.
There is no way we could answer as many questions as we do without resorting
to some shortcuts such as posting links to web pages that basically say what
we want to say instead of retyping these replies every time.

While I do agree that the message in 5003 is a little strongly worded (which
is why I no longer link to it), I have to say that the message is valid.
Multiposting IS annoying, and can cause people to start ignoring you if you
keep doing it (especially if the multipost caused them to waste their time
typing an unnecessary reply).

In your desperation to get help quickly, you unknowingly violated basic
netiquette. Repeat violations of netiquette will cause regular posters to
ignore the violator. So, instead of succeeding in getting prompt assistance,
you have instead succeeeded in causing people to "turn you off"

When informed of this, you decided to react defensively instead of admitting
your mistake and promising to do better in the future.

I have to tell you, I was very close to using the Block Sender feature in
Outlook Express rather than take the time to write this reply. Furthermore,
I will not allow you to take up any more of my time if you persist in
attempting to defend yourself in this way.

Bob Barrows
 
F

Fox

Gee, I am making friends all over the group.
Geesh, have you read that obnoxious thing Ray
sent me to. I do not object to the advice I object
to the immature attitude. He can surely express
himself well when helping people and if he was
truly trying to help me by warning me why would
he send me to an insult instead of speaking for
himself about a very simple issue which by the
way he and someone else explained afterwards
in just a few words. Could have done that in the
first place.

As I said on the other thread, even though both of
these threads should have already died, I am not new
to the NGs and I know the way things are done.
I know how some people get their rocks off and
show off by towing the line and amusing their buds.

I know other people ignore that drivel and they do help.
If you want to put a price on your help and that price is
that I never sway from your standard no matter what
the reason or that I never bother to try to meet
a deadline that can cost me my livelihood, than we
are on different pages on what it means to help people.

And I am well aware that rarely can writing back to people
who cop these attitudes in the name of how good they
are to others, ever be reached. That is simply because
they have a chip on their shoulder and they are not interested
in being sef-effacing. So if you want to be the same that is
up to you. I have always respected and have been more
than greatful and thankful for any help I ever get on the NGs.
Ray was barking up the wrong tree and insulting someone
who did not deserve nor require it. That is my issue and
my only issue.

Fox
 
F

Fox

No, now that I know that these two groups are so inticately tied I will
not be posting in both. If I knew I would not have in the first place.
We regulars take a huge part of our days answering very many questions.
There is no way we could answer as many questions as we do without resorting
to some shortcuts such as posting links to web pages that basically say what
we want to say instead of retyping these replies every time.

Understood and always known and accepted. Was not my intent to insult
anyone but to shine some light on Ray sending me to what was an insult
when I was at my wits end about my circumstances. Maybe you
can cut me slack on that one ?
While I do agree that the message in 5003 is a little strongly worded (which
is why I no longer link to it), I have to say that the message is valid.

Agreed, but not always neccesary to jump to and sometimes we need
to think outside the box and think about how we just may not realise
someone else's situation.
Multiposting IS annoying, and can cause people to start ignoring you if you
keep doing it (especially if the multipost caused them to waste their time
typing an unnecessary reply).

No doubt. And even though I felt I had to post in the other group as well
I did shut it down as soon as there was a response here. That must
say something about having at least shown some respect in spite of
what you saw as a total violation.
When informed of this, you decided to react defensively instead of admitting
your mistake and promising to do better in the future.

I reacted to an insult at a time of stress. This does not say that I do not
have the utmost respect for all the people and help I have gotten
on this board. I have been here on and off for over a year and could
not have gotten a darn thing done without the great and patient help
I have recevied. I have never intentionally double posted but have been
flamed for being on the wrong board. So each of us experiences
different things and causes us to react in different ways. Whether it
matters to you or not, I will tell that the truth is that I was about to
lose
the only thing that I had going which was going to lead to maybe being
able to support my family this coming year. Things have been awful.
I am not going to go into details, but please believe my family cannot
take anymore financial blows we are at the end of the rope. That is the
only reason I posted twice and in that I did not know I was double
posting because I know nothing about CDO but knew that the script
I was given was not going to work for me as a VBS. I never
even saw a VBS before, I am a novice to that. I knew I had to put it in a
web page to make it work so thought to ask in VBS and also thought
to ask in ASP. I posted and was sure that I would be flamed for being
in the wrong group in one or the other and had no time to reach my
deadline. That is all this is about and nothing more.

The good thing is I got out of bed at 11 last nite abd vowed to
figure out my problem. I had about 10 sample scripts and
having spent at least 6 hours reading examples and posts on web pages
I finally at 5am got what I needed working.

Please do not make me a fool for opening up.

Regards,
Fox
 
B

Bob Barrows

It's not your fault, but you're still missing the point. It's not the
"posting to two groups" to which we are objecting. Multiposting is the
problem.

That is the other reason that I no longer link to that aspfaq article: it
says nothing about the more accepted technique for posting to multiple
newsgroups: crossposting. From my canned response:

There are times when you will not be sure which group is most appropriate
and you will want to post a question to both groups. In that situation, you
should use the cross-posting technique, rather than posting the same message
multiple times. To crosspost, put a semicolon-delimited* list of the
newsgroups to which you wish to post in the To: header of your post and post
it once. It, and any replies to it, will appear in all the newsgroups in
your list. This way nobody will reply to a message that already has a valid
answer.

* ... or whatever delimiter is recognized by your news client


And that is my last word on this subject :)

Bob Barrows
 

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

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top