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?
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
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:
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:
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?
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:
where App_TRSConnectionString is declared elsewhere. It still attempts to connect and because i'm testing with an inappropriate connection string the page crashes.
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.
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.
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?
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.
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.
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?
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:
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?
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?
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.
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
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.
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.
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
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.
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
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?
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.
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?
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.