Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 5th, 2006, 02:36 PM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default send email automatically with classic asp

First of all i am sorry, this has probably come up many times before....

But i am looking for a working script will send email automtically from an ASP page.

I have tried many examples, at the moment i have this;

Code:
<% 
    sch = "http://schemas.microsoft.com/cdo/configuration/" 
 
    Set cdoConfig = CreateObject("CDO.Configuration") 
 
    With cdoConfig.Fields 
        .Item(sch & "sendusing") = 2 ' cdoSendUsingPort 
        .Item(sch & "smtpserver") = "127.0.0.1" 
        .update 
    End With 
 
    Set cdoMessage = CreateObject("CDO.Message") 
 
    With cdoMessage 
        Set .Configuration = cdoConfig 
        .From = "from@me.com" 
        .To = "crmpicco@hotmail.com" 
        .Subject = "Sample CDO Message" 
        .TextBody = "This is a test for CDO.message" 
        .Send
    End With 
 
    Set cdoMessage = Nothing 
    Set cdoConfig = Nothing 
%>
and i get this error

Error Type:
(0x8004020F)
The event class for this subscription is in an invalid partition
/picco/sendEmail.asp, line 106


Anyone got a working version? Is there something mising on my machine?

I have WinXP Pro.

Picco

www.crmpicco.co.uk
www.ie7.com
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
Reply With Quote
  #2 (permalink)  
Old June 5th, 2006, 03:47 PM
Imar's Avatar
Wrox Author
Points: 72,038, Level: 100
Points: 72,038, Level: 100 Points: 72,038, Level: 100 Points: 72,038, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,080
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

If you keep asking the same type of questions, you keep getting the same type of answers:

Did you Google for this?

Searching Google for "The event class for this subscription is in an invalid partition" will give you some very useful results. Heck, you can even choose "I'm feeling lucky" in Google and you're taken straight to the answer....

Why you keep asking questions that you can solve in a split second using Google is completely beyond me. Suggestions are welcome...

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Reply With Quote
  #3 (permalink)  
Old July 3rd, 2006, 11:10 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

hi Imar, i have looked at the ASPFAQ site, but I do not know what he is talking about or even where to start looking at???

 i have this code;

Code:
<% 
    sch = "http://schemas.microsoft.com/cdo/configuration/" 
 
    Set cdoConfig = CreateObject("CDO.Configuration") 
 
    With cdoConfig.Fields 
        .Item(sch & "sendusing") = 2 ' cdoSendUsingPort 
        .Item(sch & "smtpserver") = "67.15.20.10" 
        .update 
    End With 
 
    Set cdoMessage = CreateObject("CDO.Message") 
 
    With cdoMessage 
        Set .Configuration = cdoConfig 
        .From = "craig@crmpicco.co.uk" 
        .To = "crmpicco@aol.com" 
        .Subject = "Sample CDO Message" 
        .TextBody = "This is a test for CDO.message" 
        .Send 
    End With 
 
    Set cdoMessage = Nothing 
    Set cdoConfig = Nothing 
%>
and have this info from my host:
Email Address: craig@crmpicco.co.uk
Email Server: mail.crmpicco.co.uk
Email Server IP: 67.15.20.10

but i am getting nowhere - fast!

any thoughts???

Picco

www.crmpicco.co.uk
www.ie7.com
Reply With Quote
  #4 (permalink)  
Old July 3rd, 2006, 11:17 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

i realise that i may be trying to do it the hard way, but i cant seem to get it working on my localhost (i seem to have spent ages on this). i had it working A-OK on my machine at work, but locally i am having no luck.

i have a firewall (ZoneAlarm personal), but i am unsure if that is blocking Port 25 - as it has not alerted me.??????

Picco

www.crmpicco.co.uk
www.ie7.com
Reply With Quote
  #5 (permalink)  
Old July 3rd, 2006, 01:13 PM
Imar's Avatar
Wrox Author
Points: 72,038, Level: 100
Points: 72,038, Level: 100 Points: 72,038, Level: 100 Points: 72,038, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,080
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Do you even have a local SMTP serve running?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Reply With Quote
  #6 (permalink)  
Old July 3rd, 2006, 08:06 PM
Authorized User
 
Join Date: Jun 2003
Location: Richmond, VA, USA.
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to erobb Send a message via Yahoo to erobb
Default

With CDO you do not need local SMTP running but you do need to configure the SMTP server (if its remote) to accept email from the server you are trying to send it through. If the ip you listed is the local server then yes check that its running

If you are trying to use a remote SMTP server to send this mail check with the servers administrator and make sure your ip has permission to send mail through that server. For obvious spam reasons remote SMTP servers limit who is allowed to send mail through them.

If you are using a remote SMTP (and you are ok to send mail through it) make sure you are using 2 email addresses that have that domain. ie Do use someAddie@smtpDomain.com To anotherAddie@smtpDomain.com. For your testing dont try someAddie@smtpDomain.com To myAddie@hotmail.com.

On remote SMTP even though you can sometimes send email they will not allow you to relay out of the network for security reasons.

Earl
www.jhdesigninc.com

Reply With Quote
  #7 (permalink)  
Old July 4th, 2006, 09:56 AM
Authorized User
 
Join Date: Jun 2003
Location: Richmond, VA, USA.
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to erobb Send a message via Yahoo to erobb
Default

A couple of more observations the ip you gave is not localhost. Localhost 127.0.0.1

The error trying to send mail through this server is.
Error is The transport failed to connect to the server.

Its definately a network or SMTP config issue. You may want to post this to a network group. This is not a question for the ASP group.

Earl
www.jhdesigninc.com

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP classic Form to Email problem melkin Classic ASP Basics 0 April 19th, 2007 10:28 AM
how to send https request in classic asp johndoewn Classic ASP Professional 1 March 25th, 2006 12:37 AM
send an email to someone automatically crmpicco Classic ASP Basics 10 March 3rd, 2005 06:13 PM
send an email to someone automatically crmpicco VB How-To 1 February 25th, 2005 08:59 AM
ASP: automatically sending email report luxx Classic ASP Databases 1 January 12th, 2004 04:50 AM



All times are GMT -4. The time now is 05:45 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.