Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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 November 10th, 2009, 04:45 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 112
Thanks: 12
Thanked 0 Times in 0 Posts
Default CDONTS.NewMail ???

Hi to all...

I'm using the simple code to send an email...
the email look to get stuck in "C:\Inetpub\mailroot\queue\" folder...
I get NO errors on my web page nor i get the email...
the DLL is installed...

Can someone please help... i do not know what else to try...

Thanking you in advance...

Rino

Dim objNewMail
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = fromEmail
objNewMail.To = toEmail

objNewMail.Subject = "Testing"
strBody=strBody & fromEmail &" Testing"
objNewMail.Body=strBody

objNewMail.Send
Set objNewMail = Nothing
 
Old November 10th, 2009, 05:43 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I am due at a meeting so very quickly:

CDONTS is kind of depriciated now. On server -> 2003 the CDONTS.dll is not even there anymore. It must be dowloaded and registered for CDONTS to work. You need to be be using CDOSYS. here is a code example:

Const cdoSendUsingPort = 2
Dim iMsg,iConf,Flds,strHTML,strSmartHost
StrSmartHost = "10.?.?.?" 'place you SMTP address here
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/con...tion/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/con...ion/smtpserver") = strSmartHost
.Item("http://schemas.microsoft.com/cdo/con...nectiontimeout") = 10
.Update
End With
With iMsg
Set .Configuration = iConf
.To = trim(request.form("tEmail"))
.From = Mail_From
.Subject = "Some subject"
.HTMLBody = "Your message body"
.Send
End With
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
__________________
Wind is your friend
Matt
 
Old November 10th, 2009, 05:45 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

NOTE - I pasted incorrect code initially. Ignore the code in your first email. I have corrected it above
__________________
Wind is your friend
Matt
 
Old November 10th, 2009, 05:56 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 112
Thanks: 12
Thanked 0 Times in 0 Posts
Default

I get no error on my page but the email goes in the badmail folder...
 
Old November 10th, 2009, 10:39 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Firstly you should stop using CDONTS and use the reccomended CDOSYS mail method. This will take you a few miuntes to alter your code and hey, your issue may go away

I used to use CDONTS like most would have however never experienced this issue. Should I assume the mail is not getting sent, this is what caused you to look in this folder? I would say either of the following need to be looked at:

> Do you have valid email addresses in the 'fromEmail' and 'toEmail' variables?
> Is the SMTP service running and configured properly? Have you sent emails from this box before?

Anyhow as I said you should use the CDOSYS code
__________________
Wind is your friend
Matt
 
Old November 11th, 2009, 10:51 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 112
Thanks: 12
Thanked 0 Times in 0 Posts
Default

i removed the CDONTS code and put yours in with CDOSYS and it still does not work...
they get stuck in the queue folder...
its a valid server that sends email on a daily basis already...
the from to email address are correct...

is there somethign else i can check???

Rino
 
Old November 11th, 2009, 05:59 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

So you are now using the CDOSYS mail which means you have placed an IP address at this point?

StrSmartHost = "10.?.?.?"

You say it sends mail every day. Do you mean ASP scripts are sending mail everyday using SMTP? If so then its easy, compare the code being used that script to yours. If not and you are refering to other mail being sent then you still arnt aware of ASP scripts using SMTP that are successfully sending mail. I would do two things:

1..Look up the Telnet code to send a message using command line. This will tell you for sure if the IP address you are using works and the SMTP service is installed, running and has been configured which enables you to send mail

2..depending on the setup for EG exchnage you may need to vaidate any mail that is going to any outside address. Check this by sending internal mail, does this work? In our network we can only send internal mail without validation against an existing exchnage account.
__________________
Wind is your friend
Matt
 
Old November 11th, 2009, 06:33 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 112
Thanks: 12
Thanked 0 Times in 0 Posts
Default

i should have been more specific...
i send regular emails with outlook and i have a VB application that send emails daily though outlook...

1. i can telnet to the server with port 25 but it stays in the queue it doesn't sent it...
this is the commands i use
helo
mail from
rcpt to
data
.
"sending to queue" but doesn't

2. from this server i can send internal or external email not a problem...
 
Old November 11th, 2009, 06:45 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

If it doesnt work using telnet the fix is outside the scope of ASP and related code. Also outside the scope of my knowledge. Your network admin need to ensure the SMPT service is in a state so ASP code can send mail. Developers and network guys, two different jobs. Get the network guy to do his job then you can do yours.

Sorry to deliver bad news but your .asp page is not going to work until you can Telnet using the SMTP IP address successfully.

Sorry I cant help. Any issues with ASP I will do my best to assit, good luck

BTW you say:
;;;from this server i can send internal or external email not a problem...
I am not refering to mail sent by Outlook. I refer to mail sent using ASP
__________________
Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
using CDONTS.NewMail to send an email??? RinoDM HTML Code Clinic 1 November 16th, 2009 10:49 AM
cdonts p2ptolu Classic ASP Databases 1 March 8th, 2005 11:48 AM
CDONTS mikedeepak Classic ASP Components 3 August 26th, 2004 06:52 PM





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