Wrox Programmer Forums
| 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 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 April 24th, 2006, 10:20 PM
Registered User
 
Join Date: Apr 2006
Location: Liberty, MO, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Send E-mail from .asp page

Trying to send e-mail using code from Chapt 22, Wrox "Pro ASP 3.0".
My code:
<%
dim objSendMail
Set objSendMail = CreateObject("CDONTS.NewMail")
With objSendMail
    .From = "Me@Something.com"
    .To = "You@Something.com"
    .Subject = "New Send Mail Program"
    .Body = "This is the body."
    .Send
End With
Set objSendMail = Nothing
%>

No errors sent back, but no e-mail sent either.
Any HELP appreciated !


Larry
 
Old April 24th, 2006, 11:16 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Waht server are you using? CDONTS has been depreciated by MS (2003 server). You can make it work by downloading the cdonts.dll (dont forget to register it)

FYI: Use the search within this forum. There are many solutions here, have you tryed this?


IMO you should be using CDOSYS:
<!--
Sending SMTP mail via port 25 using CDOSYS This ASP page
uses CDOSYS to send SMTP mail using port 25 of the SMTP
server that is set. The e-mail delivery is handled by the
SMTP server that is set in the configuration object.
-->
<%
Const cdoSendUsingPort = 2
Dim iMsg,iConf,Flds,strHTML,strSmartHost
StrSmartHost = "192.168.0.9"
set iMsg = CreateObject("CDO.Message")
set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

'set the CDOSYS configuration fields to use port 25 on the SMTP server
With Flds
   .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
   .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
   .Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
   .Update
End With

'apply the settings to the message
With iMsg
   Set .Configuration = iConf
   .To = "aaa@bbb.com.au"
   .From = "ccc@ddd.com.au"
   .Subject = "CDOSYS Test"
   .HTMLBody = "Sent using CDOSYS..."
   .Send
End With

' cleanup of variables
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing

response.write "mail sent"
%>

Wind is your friend
Matt
 
Old April 28th, 2006, 05:42 PM
Registered User
 
Join Date: Apr 2006
Location: Liberty, MO, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got it figured out - Thanks

Larry




Similar Threads
Thread Thread Starter Forum Replies Last Post
Send mail and attachments with PHP mail function Lofa Beginning PHP 1 June 2nd, 2008 03:24 PM
mail send error :page cannot be displayed KamalRaturi ASP.NET 2.0 Professional 2 May 5th, 2008 10:59 AM
Send Mail with Attachment using Asp rajchennai J2EE 0 June 30th, 2007 01:39 AM
How to send the mail in ASP.NET n.nsivakumar ASP.NET 1.0 and 1.1 Professional 2 July 26th, 2006 03:49 PM
Send mail failed using asp.net anujrathi ASP.NET 1.0 and 1.1 Professional 1 June 22nd, 2006 07:59 PM





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