Wrox Programmer Forums
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 5th, 2006, 02:36 PM
Friend of Wrox
 
Join Date: Jan 2005
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 = "[email protected]" 
        .To = "[email protected]" 
        .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
 
Old June 5th, 2006, 03:47 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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
 
Old July 3rd, 2006, 11:10 AM
Friend of Wrox
 
Join Date: Jan 2005
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 = "[email protected]" 
        .To = "[email protected]" 
        .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: [email protected]
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
 
Old July 3rd, 2006, 11:17 AM
Friend of Wrox
 
Join Date: Jan 2005
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
 
Old July 3rd, 2006, 01:13 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 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
 
Old July 3rd, 2006, 08:06 PM
Authorized User
 
Join Date: Jun 2003
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 [email protected] To [email protected]. For your testing dont try [email protected] To [email protected].

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

 
Old July 4th, 2006, 09:56 AM
Authorized User
 
Join Date: Jun 2003
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






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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.