473,387 Members | 1,771 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

CDO Mail: verify send

win2k server IIS5
CDO Mail

Using CDO mail, I'm looping through several email addresses and sending
emails. Everything works fine, however, I'd like to set a variable based on
the success or not of the email being sent, i.e.,

<%
CDO Mail stuff...

With objMessage
.To = loopEmail
.From = conFromEmail
.Subject = conSubject
.HTMLBody = conHTML

'****** This is the section I'm trying to set the variable.
'Even though the email is sent, strSent
'always results as the Else clause.
If .Send Then
strSent = "sent"
Else
strSent = "error sending"
End If

'********
End With

CDO Mail stuff....

%>

The emails are being sent, however, the variable for 'strSent' always comes
out to the Else clause which is odd since the email is sent. How can I set
the variable 'strSent' based on the success or not of the CDO message
successfully being sent?

--

kindler chase
http://www.ncubed.com
SuperInvoice: For the Financially Unorganized

news://news.ncubed.com/support
n3 Support Group
Jul 19 '05 #1
2 2810
If there's an error, it's going to die on .send, so the if and the else will
never be reached. I don't believe .send returns a graceful boolean, so
you'll have to use the old style:

on error resume next
..send
if err.number <> 0 then
strSent = "sent"
else
strSent = "error..."
end if

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/

"Kindler Chase" <billyboy@DELETE_ME_roubaixinteractive.com> wrote in message
news:ea**************@TK2MSFTNGP09.phx.gbl...
win2k server IIS5
CDO Mail

Using CDO mail, I'm looping through several email addresses and sending
emails. Everything works fine, however, I'd like to set a variable based
on
the success or not of the email being sent, i.e.,

<%
CDO Mail stuff...

With objMessage
.To = loopEmail
.From = conFromEmail
.Subject = conSubject
.HTMLBody = conHTML

'****** This is the section I'm trying to set the variable.
'Even though the email is sent, strSent
'always results as the Else clause.
If .Send Then
strSent = "sent"
Else
strSent = "error sending"
End If

'********
End With

CDO Mail stuff....

%>

The emails are being sent, however, the variable for 'strSent' always
comes
out to the Else clause which is odd since the email is sent. How can I
set
the variable 'strSent' based on the success or not of the CDO message
successfully being sent?

--

kindler chase
http://www.ncubed.com
SuperInvoice: For the Financially Unorganized

news://news.ncubed.com/support
n3 Support Group

Jul 19 '05 #2
Aaron Bertrand [MVP] wrote:
If there's an error, it's going to die on .send, so the if and the
else will never be reached. I don't believe .send returns a graceful
boolean, so you'll have to use the old style:

on error resume next
.send
if err.number <> 0 then
strSent = "sent"
else
strSent = "error..."
end if


Thanks Aaron. :)

--

kindler chase
http://www.ncubed.com
Home of SuperInvoice: The Online Invoicing Application.
Organize your billing process and impress your clients.

news://news.ncubed.com/support
n3 Support Group
Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Giobibo | last post by:
I use the following code to send e-mails with PHP: if(@mail(....)) { //Send OK } else { //Send Bad } But how can I verify that a message was really sent (in case of "Sent
2
by: Safras Ahamed | last post by:
I have windows xp pc and i have installed apache as a web server and php also working fine, but when i am sending mail, its giving me following error when upload same to linux live server its...
2
by: MostlyH2O | last post by:
Hi Folks, I run a small website for a membership organization - and I have created an ASP front end for an access database that allows the board members to manage their membership roster (names,...
3
by: rob_keith | last post by:
Hi, I've been able to successfully configure SQL Server Agent to send notification emails to an appropriate Operator in the event of an alert being fired. This all works fine on one condition -...
1
by: apasj06 | last post by:
hello everyone: I am trying to send email via php. I using window XP home edition. My mail client is outlook express. I configured mail client to send email via my aol email account. mail...
0
ankur30884
by: ankur30884 | last post by:
Hi Friends I am again hear with a small problem, help im trying to send a mail to extranl e-mail using Asp.net code i try use system.net.Mail system.net namespace to send mail but...
1
by: Nelliwinne | last post by:
I do not have proper excellence at php programming. I wrote below script after reading several articles. Anyway that form-to-mail script doesn't work. form action is connected to following code ...
7
by: =?Utf-8?B?Tmlrb2xheSBQb2Rrb2x6aW4=?= | last post by:
Good afternoon, community! How you help me? I need to know, how could I verify e-mail address? I don't mean ( for example: test@test.com it is valid or not) I wanna know is that real world...
4
borisding
by: borisding | last post by:
Hi there, Well, I really need help from someone here, and hope that someone will answer my question and solve my problem. I know it's very common question and being asked by many developers: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.