ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 2nd, 2009, 04:14 PM
prasath_s01 prasath_s01 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2008
Posts: 45 prasath_s01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 34 m 12 sec
Reputation Power: 2
VBScript - Email - CDO mail

Hi I am using the following code for sending a mail from asp page.I am not sure how to track whether the email is sent or delivered.Even i give a wrong to address like 'ono@on.com'
I am getting err.number is 0.Can somebody explain me to track it.In which case the err.number hold the value.

Set myMail=CreateObject("CDO.Message")
on error resume next
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.HTMLBody = "<h1>This is a message.</h1>"
myMail.Send

if err.number <> 0 then
response.write "Error number " & err.number & " Error Desc " & err.description
err.clear
end if

Reply With Quote
  #2  
Old July 3rd, 2009, 07:31 AM
naturebest07@gm naturebest07@gm is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 43 naturebest07@gm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 2
try out below code :

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<%
Dim strMessage
strMessage = Request.Form("fieldname1") & request.Form("fielname2")
theSchema="http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig=server.CreateObject("CDO.Configuration")
cdoConfig.Fields.Item(theSchema & "sendusing")= 2
cdoConfig.Fields.Item(theSchema & "smtpserver")="your smtp address"
cdoConfig.Fields.Update
Set cdoMessage=Server.CreateObject("CDO.Message")
cdoMessage.Configuration=cdoConfig
cdoMessage.From=Request.Form("sender's mail")
cdoMessage.To="receiver's mail address"
cdoMessage.Subject= Request.Form("subject")
cdoMessage.TextBody= strMessage
cdoMessage.Send
Response.Redirect("http://www.yoursite.com")

Set cdoMessage=Nothing
Set cdoConfig=Nothing
%>
</body>
</html>

Reply With Quote
  #3  
Old July 6th, 2009, 11:08 AM
prasath_s01 prasath_s01 is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jun 2008
Posts: 45 prasath_s01 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 34 m 12 sec
Reputation Power: 2
Error message

If i had given some invalid email address in the to list, it should throe some error.

I tried giving some invalid address but its not throwing errors.

Reply With Quote
  #4  
Old July 7th, 2009, 12:00 AM
Nilpo's Avatar
Nilpo Nilpo is offline
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Jun 2006
Location: Salem, OH
Posts: 1,877 Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)Nilpo User rank is General (90000 - 100000 Reputation Level)  Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1Folding Points: 214558 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Week 2 Days 8 h 39 m 25 sec
Reputation Power: 967
Send a message via ICQ to Nilpo Send a message via AIM to Nilpo Send a message via MSN to Nilpo Send a message via Yahoo to Nilpo Send a message via Google Talk to Nilpo Send a message via Skype to Nilpo Send a message via XFire to Nilpo
Facebook MySpace Orkut
Simply put, the function CAN'T determine whether or not an email is successfully delivered because that delivery is handled by another mail server.

Google for Delivery Status Notification. The CDO object supports it.
__________________
Don't like me? Click it.

Scripting problems? Windows questions? Ask the Windows Guru!

Stay up to date with all of my latest content. Follow me on Twitter!

Help us help you! Post your exact error message with these easy tips!

Reply With Quote
  #5  
Old July 10th, 2009, 02:34 AM
naturebest07@gm naturebest07@gm is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 43 naturebest07@gm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 31 m 56 sec
Reputation Power: 2
Replace fieldname1, fielname2, your smtp address, sender's mail, receiver's mail address, subject,http://www.yoursite.com with your values.

Hope it helps you out

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > VBScript - Email - CDO mail


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
Stay green...Green IT