Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
Sending email through autoscript - part 2
Old 04-05-2007, 11:18 AM Sending email through autoscript - part 2
Super Talker

Posts: 116
Trades: 0
Hi all,

Guess what.... my vb.exe didn't work in sending an autoemail to our daily artist spotlight. What's going on is that the server is still executing the script but the email isn't being sent out.

I'm starting to think it's the connection string I'm using or ASP Mailer.

DZ

* Here's the code *
First, the connection string:
***********
Dim Connect, Connect_String, rsSpotlight, strSpotlightQ

set Connect = Server.CreateObject("ADODB.Connection")

Connect_String = "PROVIDER=SQLOLEDB;Data Source=databaseserver;Initial Catalog=name;USER ID=username;PASSWORD=9999999;"

Connect.Open Connect_String

set rsSpotlight = Server.CreateObject("ADODB.Recordset")
set rsSpotlight.ActiveConnection = Connect

strSpotlightQ = "Select * from AtlasSpotlight WHERE ID = '" & lnID & "'"
rsSpotlight.Open strSpotlightQ

*******
then I'm using a Server-Side include to read in the letter...
Dim strMessage

<!--#INCLUDE file="SpotlightLetter.asp"--> (this writes to strMessage)

***********
Then sending the email with ASP Mailer (I'm not using CDONTS because our server no longer supports it)

Set Mailer = Server.CreateObject("SMTPsvg.Mailer")

Mailer.FromName = "Atlas Artist Spotlight"

Mailer.FromAddress = "name@host.com"

Mailer.RemoteHost = "relay.host.com"

Mailer.Subject = "Your Spotlight Notification For " & Trim(rsSpotlight("Artist_Name"))

Mailer.AddRecipient Trim(rsSpotlight("Contact_Name")), Trim(rsSpotlight("Contact_Email"))

Mailer.cc = "techperson@host.com", "me@host.com"

Mailer.BodyText = strMessage
Mailer.SendMail
Set Mailer = nothing

rsSpotlight.Close
Connect.Close
DonnaZ is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-05-2007, 11:19 AM Re: Sending email through autoscript - part 2
Super Talker

Posts: 116
Trades: 0
I wanted to say that the above works in an ASP page, but not with autorunning - calling up the ASP page from the server.

I'm really dumbfounded. So is the hosting company.

DZ
DonnaZ is offline
Reply With Quote
View Public Profile
 
Old 04-05-2007, 11:55 AM Re: Sending email through autoscript - part 2
ExpressoDan's Avatar
Ultra Talker

Posts: 317
Name: This Space for Rent
Location: Georgia
Trades: 0
Test the pieces individually on your local machine. You might not be able to do the mailing part, but you can comment that part out and test the database stuff. Then put it all together once you know each piece is working.

Do you have to use SMTPsvg.Mailer? I dont know anything about it. Can you use CDOSYS? There's a lot of support on the web for CDOSYS that you could use to put a script together.
__________________

Please login or register to view this content. Registration is FREE

"I think therefore I am, I think." <!-- George Carlin

Last edited by ExpressoDan; 04-05-2007 at 11:56 AM.. Reason: I'm a dummy that cant spell
ExpressoDan is offline
Reply With Quote
View Public Profile Visit ExpressoDan's homepage!
 
Old 04-05-2007, 12:03 PM Re: Sending email through autoscript - part 2
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Perhaps you're looking at the problem from the wrong angle, Donna. What if you wrote a VBS file that called an ASP page with the same code?

Having said that, I can see a few things off the top:

1) VB doesn't support Server.CreateObject (it's just CreateObject).
2) VB also doesn't support server-side includes in the sense that you tried it.

Donna, I'm going to PM you a link that may help. I'd drop it like it's hot in the forum, but it's my own link so I don't want to be accused of link dropping.

As far as CDOSYS is concerned, you may want to use CDOSYS instead, as Dan said. It's usually supported on both Windows 2000 and 2003 servers (whereas CDONTS is only supported on Win2K).
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)

Last edited by ADAM Web Design; 04-05-2007 at 12:08 PM..
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 04-07-2007, 12:11 PM Re: Sending email through autoscript - part 2
Super Talker

Posts: 116
Trades: 0
Everyone, thanks

Adam... I suspected that was the problem that VBS wasn't supporting certain functions.

It's funny because I saw a book yesterday at Barnes and Nobel on VBScript. I may go back and get it.

Thanks for the code you sent. I'm going to give it a try this week. I officially left my company - but I'll be doing some asp/asp.net coding projects for them as I work for my new. I can use the cash.

What I find interesting is that there's are real place for us ASP/VBScript dinosaurs. I was shocked that no one at our hosting company had a clue about any of it.

Donna Z.
DonnaZ is offline
Reply With Quote
View Public Profile
 
Old 04-07-2007, 01:58 PM Re: Sending email through autoscript - part 2
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
They're server admins, not coders, Donna. You can only expect so much from them.

Seriously, they very rarely get involved in that sort of thing and don't offer much (if any) support. You're on your own in that regard unless you get lucky and someone's already gone down the path for you.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to Sending email through autoscript - part 2
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.84336 seconds with 12 queries