Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

cdonts newmail object return value

Posted on 2002-03-08
2
Medium Priority
?
254 Views
Last Modified: 2011-10-03
i'm using the cdonts newmail object to send email, does the send method have a return value?, if an error occurs with the send i want to get an indicator
0
Comment
Question by:asmotritsky
2 Comments
 
LVL 20

Expert Comment

by:jitganguly
ID: 6851762
...
...
obj.send
On error resume next
if err.number <> 0 then
Response.Write "Error"
else
Response.Write "No error"
end if
0
 
LVL 11

Accepted Solution

by:
thunderchicken earned 200 total points
ID: 6851765
What kind of errors?

If it's an invalid email address you wont know until it's sent back to you.  You can always do this:

On Error Resume Next
set mymail = Server.CreateObject("CDONTS.NEWMAIL")
mymail.to = "whoever@wherever.com"
mymail.from = "foo@fooland.com"
mymail.subject = "blah"
mymail.body = "blah blah"
if err <> 0 then
  mymail.send
else
  response.write "ERROR!"
end if
set mymail = nothing

other than that, you wont know until after it's sent.  You can do FSO checks on the folders in C:\inetpub\mailroot

I belive those are QUEUE, BADMAIL and DROP or something like that.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

963 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question