Error Trapping While Sending Email

I have a mail script but don't know how to catch any errors so that it will display email address that failed to send. Here is my code...

Dim mail
Set mail = Server.CreateObject("CDO.Message")
mail.From = "from@mail.com"
mail.Bcc = "bcc@mail.com, bcc2@mail.com"
mail.To = "to@mail.com"
mail.Subject = "This is the subject of the email"
mail.HTMLBody = "I am the message that will be displayed in the body"
mail.Send()
Set mail = Nothing

How can I display a message that says that there's an error with sending the mail?

View Replies


ADVERTISEMENT

Sending Email Error

i have a script that allows user to register and then it is supposed to send an email for them to complete registration, the process of registration works ( the data can be seen in the database ) but it errors on submit when it tries to send an email out

Microsoft VBScript runtime error '800a01ad'

ActiveX component can't create object: 'CDONTS.NewMail'

/members/inc/mailobject.asp, line 16

I can go into the database and change the confirmed field to yes and that allows the user to log in but they cant get the email or login with this error pending - Code:

View Replies View Related

Error Trapping

Need help with some basic error trapping. This code traps the error and successfully redirects to the error handling page.

If Err.Number <> 0 Then
Response.Redirect("../main/ErrorHandler.asp?error=noconnection")
End If
On Error GoTo 0

I meant to use this code to send myself an email with error details but it is not working. I get my nicely formatted email but instead of error values there is nothing. Why would all Err. be empty?

I suspect that the problem is with the error occuring on one page but actual handling of the error is meant to be on some other page but I am not sure here. Code:

View Replies View Related

Trapping A Certain XML Error

I'm using the MSXML2.ServerXMLHTTP object.

I am pulling documents (PDF, to be exact) from a remote server, and it all seems to work fine. However, I cannot control that particular database in which the documents are stored.

Currently, the DB where the documents are stored is down, and when I use the object above, naturally, I get the 500 error(my error log states that it's a timeout). How can I write a custom error message to display in a browser, instead of the usual HTTP 500 Internal server error page?

The code I have is below ...

View Replies View Related

Error Trapping

i want to perform error trapping on the connection to a server,so if the SQL server is inaccessible the site does not crash.I'm using javascript and hoped the try.catch might work.this is want I've tried in an existing piece of ASP script:

%>
try
{ "<%strTRSConnect.Open App_TRSConnectionString%>";}
catch(e)
{ alert("Error occurred ::::" + e.description) }
<%

where App_TRSConnectionString is declared elsewhere. It still attempts to connect and because i'm testing with an inappropriate connection string the page crashes.

View Replies View Related

Not Trapping Error IE7

how to get IE to report the line number of the error in the source file, when an error occurs? at the moment it just gives me the error number '500'.

View Replies View Related

Error Trapping Question

i need the best way to catch any error on a specific page.

i have a page that connects to a database on an AS/400 and there is a possibility that a certain condition might exist on the 400 that causes my page to bomb. i have no real way of specifically testing for this condition (not easily anyway) so i just want to write out a general error message if ANY error occurs on the page since it will be very rare.

View Replies View Related

Global Error Trapping

Is it possible with "classic" ASP to set up a process where anytime someone encounters a server-side error, it will e-mail the error message to me? I know I've done this with .NET, just can't remember exactly how.

View Replies View Related

Trapping Odbc Error

I have a data-driven website that allows users to enter records for sales leads. It all works perfectly. The only thing I want to do right now is prohibit users from entering the same lead twice.

I have a PK field in the MS Access database that, obviously, disallows duplicate records. However, when such an attempt is made, the browser
redirects to some generic ODBC error page with some cryptic numbers and other information that will stymie the users. "It doesn't work", they will say. The text of that error indicates that they tried to add a record that violates the PK rule of disallowing duplicate records. But they probably won't read it and it's truly ugly anyway.

How can I redirect to a custom error page or trap the error before the ODBC error page is displayed and just display a msgbox or something telling the user they attempted to add a record that already exists?

View Replies View Related

Error Trapping The Dreaded Refresh

My problem basically is as follows:

1) User enters their details to create a new account in my db.

2) They press the submit, the system successfully creates their new account
and then displays a page saying 'well done you've created your new account'.

3) The doofus (or clever clogs) clicks the Refresh button, which in turn
submits the details back to the db and creates a duplicate entry in my db.
I don't have a duplicate account num, as the system takes the max last one
and adds one to it so really no errors are generated, but it does mean that
they have 2 accounts now.

As mentioned above, this scenario crops up when doing a New Account page and
when they've just posted their order via the shopping cart final page (shall
we say). The latter worries me because duplicate orders would cause a lot
more hassle.

View Replies View Related

Trapping A Crystal Report Error.

how to trap the error if the cause is the concurrent user. from iis server my 500-100.asp page is coded to trap errors that came from crytal report. below is the code that has been used.

if instr(lcase(objASPError.file), "rdcrptserver11.asp") <= 0 then
SendEmailNotification objAspError
end if

this piece of codes means if theres a error from rdcrptserver11.asp it would send a notification to me right? what if i dont want to get email notification if ther error is exceeding the concurrent user. what would i do stop the sending of notification when that happens.

View Replies View Related

Sending Email

I have a few queries regarding on email. Currently my web hosting provider uses Windows 2003 Server IIS 6.0 to host my ASP websites. In my own PC, I am also currently using Win XP Profession IIS 6.0 to run my ASP files.

I would like to create a pogram that would automatically sent out an email. But the problem is I have know that CDONTS do not work for Windows 2003 Server or XP Professional. It only currently work for Win 2000 Server.

Please help and perhaps show me the code of sending an email out automatically. Is there a code that can work for all servers?

View Replies View Related

Sending An Email From Within ASP

I have a form which will be processed by being sent to an ASP page. I would
like the ASP page to take the data from the Request.QueryString (which I
know how to do) and format it so I can have it emailed to me in a nicer
format. My problem is that I do not know how to have ASP send an email. I
know how to send an email using the mailto: protocol by making it look
something like the following:

MAILTO:username@mydomain.com?SUBJECT=mysubject?MES SAGE=mymessage

However, this will usually take the user to their default email client and
ask them to send an email by putting the specified subject and message in
for them, but wait for them to do any desired editing and click their send
button. I simply want the email to be sent straight from ASP. Is this
possible?

View Replies View Related

Sending An Email

Can anyone provide me with an example how I can send an email through ASP.NET!

View Replies View Related

Sending Email

I have made a .asp file in order to send email to my Join Bytes!:

<%
Set mail = Server.CreateObject ("CDONTS.NewMail")
mail.To = "email@email.com"
mail.From = "mail@mail.com"
mail.Subject = "email subject"
mail.Body = "email body"
mail.Send
%>

The smtp function have been installed with the IIS, there is no error and the .asp seems running properly but I can't receive any email, any wrong?

View Replies View Related

Sending Email

i have to do a project regarding employee transfer in which sending email to concerned employees yet to be transferred play a pivot role.

View Replies View Related

CDO Not Sending Email

I've been using CDO to send email from my web server for a while now but
today the emails aren't being sent. They are in the queue folder on my
server. I've restarted SMTP service but that didn't work. How can I get
these sent?

View Replies View Related

Sending Email

how can send email using ASP?

View Replies View Related

ASP Email Sending

Im have made up a form that sends the information via email to an email address. Whenever I test the form though, the email does not display in HTML format. The email displays the html code but I want it to display as an html page.

View Replies View Related

Sending Email Via .asp

Set ObjMail = CreateObject("CDONTS.NewMail")
ObjMail.From = emlFrom
ObjMail.To = emlAddress
ObjMail.Subject = emlSubject
ObjMail.Body = emlBody
ObjMail.Send
Set ObjMail = Nothing

I recently upgraded my webserver from NT4.0 to Windows 2003 Web Edition. Now, the above code no longer works. It worked great on NT4

What do I need to do to make it work with my new server?

View Replies View Related

Sending Email In ASP...

I am trying to send an email to someone as the person clicks on a link...i have been trying the CDO, CDONTS, JMail and other methods but none of them work!!an example is as follows:

Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="mymail@mydomain.com"
myMail.To="someone@somedomain.com"
myMail.TextBody="This is a message."
myMail.Send

I Im getting this error:

CDO.Message.1 error '80040220'

The "SendUsing" configuration value is invalid.

View Replies View Related

Sending Email With ASP

I need a way to send an email using a normal HTML form and then taking those values and sending them to myself.

View Replies View Related

Sending Email

Could someone advise me on the best way to send email either using asp or html? I'm not sure which way would be best. Basically I have a page confirming that data has been entered into a database and displaying what has been entered. I then want to have a link to email the information to someone. The email address has already been entered into the database.

View Replies View Related

Sending Email With CDO

I asked how to send an email using CDO instead of CDONTS and got several responses. They were all good, I tested the code and it works well. However, I forgot to mention that I need to set the email body to be in HTML rather than in plain text format. Would appreciate if someone could post a complete example on how to do this.

View Replies View Related

Sending Email

I have tried to use this peace of code to send test email

If Request.form("submit")="Submit" Then
Set objMail = CreateObject("CDONTS.NewMail")
objMail.To = "alex@alex"
objMail.From = "alex@alex"
objMail.Subject = "Feedback"
objMail.BodyFormat = "0" ' -- HTML format
objMail.Body = "Name: "
objMail.Send
Set objMail = Nothing
end if

It works fine but when I go to the drop folder it is filling it with hundreds of emails. When I look inside pickup folder there is only one email message. Does anyone knows why the drop folder is constantly filling with new email messages?It looks like it repeats it all the time like some kind of loop.I am using it locally for testing only

View Replies View Related

Sending Email

I am using an asp page to send email from a access database. I would like it to send an HTML version if it can, and if not then it will send plaintext. I have seen this feature before, but not sure if asp can handle it.

View Replies View Related

Sending Email

I have written a code to send email through asp. I want to make particular text bold or underline in the main body of the message. Code:

View Replies View Related

Sending Email Using ASP

I want to test my mail method, when i was setting up IIS i installed stmp so thats ok. When i send the mail it goes into the mailroot folder and into a folder called queue but it does'nt actual send to the address?


Set EnquiryMail = CreateObject("CDONTS.NewMail")
EnquiryMail.From = "admin@nci.ie"
EnquiryMail.To = Email
EnquiryMail.Subject = "Access to NCI Recruitment"
EnquiryMail.Body = BodyText
EnquiryMail.Send
Set EnquiryMail = Nothing

View Replies View Related

Sending Email Thru ASP

how to send emails ..thru asp code?

View Replies View Related

Sending Email

I have made one site for me, I have created one contact us page where user can fill the form and send his message to us. I am using SMTP to send email to my domain and I also want to send confirmation email to visitor but email does not go specially when domain are hotmail and yahoo etc.
I am using code like this:

Dim emailMessage As New Mail.MailMessage
emailMessage.From = "visitorsEmailAddress"
emailMessage.To = "myEmailAddress"
emailMessage.Subject = "Email from web"
emailMessage.Body = "Message here"
SmtpMail.SmtpServer = "myServerAddress"
SmtpMail.Send(emailMessage)

Can some body tell me how I can configure SMTP to send 2 way emails from my web page?

View Replies View Related

Sending Email

I scoured the forums and am looking for the easiest solution to send email through .asp.
cfm/php all have easy defined tags that allow this. Does .asp have a similiar solution?

I've seen a lot about cdonts,yet to read this,if there is another way,if not,i better start reading.

View Replies View Related

Sending Email

I have tried to use this peace of code to send test email

If Request.form("submit")="Submit" Then
Set objMail = CreateObject("CDONTS.NewMail")
objMail.To = "alex@alex"
objMail.From = "alex@alex"
objMail.Subject = "Feedback"
objMail.BodyFormat = "0" ' -- HTML format
objMail.Body = "Name: "
objMail.Send
Set objMail = Nothing
end if

It works fine but when I go to the drop folder it is filling it with hundreds of email. I thought my seting objMail to nothing it would stop sending it. When I look inside pickup folder there is only one email message. why is it happening?

View Replies View Related

Sending Email

the best way to send email either using asp or html? I'm not sure which way would be best. Basically I have a page confirming that data has been entered into a database and displaying what has been entered. I then want to have a link to email the information to someone. The email address has already been entered into the database.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved