By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,706 Members | 1,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,706 IT Pros & Developers. It's quick & easy.

Getting an... overflow error?... when attempting to Send mail via Bamboo SMTP

pbmods
Expert 5K+
P: 5,821
I feel almost embarrassed to post in this forum, but I can't exactly pick my clients' technologies, so here we are.

I'm supporting a client project written in ASP. Part of the project that doesn't work is a form mailer.

Here's what's up:

We have some code that looks like this:
Expand|Select|Wrap|Line Numbers
  1. set smtp = Server.CreateObject("Bamboo.SMTP")
  2. smtp.Server = "__MUNGED__"
  3. smtp.ContentType = "text/html;"
  4. smtp.Rcpt = "__MUNGED__"
  5. smtp.From = FromAddress
  6. smtp.FromName = Displayname
  7. smtp.Subject = "Custom Trip Quote Submitted: " & now()
  8. smtp.Message = Body
  9. on error resume next
  10. smtp.Send
  11.  
  12. if err then
  13.     Response.Redirect("custom_quote.asp?error=3&message=" & err & "")
  14. else
  15.     Response.Redirect("custom_quote.asp?error=2")
  16. end if
  17. set smtp = Nothing
  18.  
Assume that variables such as Body, Displayname and FromAddress are all storing the correct values (because they are ^_^).

Here's what happens. User submits the form. The ASP script above executes.

The email does not get sent; instead, this statement gets evaluated:
Expand|Select|Wrap|Line Numbers
  1. if err then
  2.     Response.Redirect("custom_quote.asp?error=3&message=" & err & "")
  3.  
Which redirects to:
custom_quote.asp?error=3&message=-2147352567

What's interesting is that the message value looks suspiciously like an overflow value.

So I'm curious. What's going on, and how do I fix it?

Feel free to vent about any poorly-written code... 'cause I didn't write it :)
Aug 14 '07 #1
Share this Question
Share on Google+
6 Replies


jhardman
Expert 2.5K+
P: 3,405
The positioning of the on error line is odd. It suggests that the script is creating the mail object just fine, populating the different attributes, but then fails during the send command. This suggests to me that the bamboo mailer is not able to send email. Is it failing in other applications as well?

You should be able to print out the error message, it's err.message or err.name or some such. It is also informative at times to comment out the on error line to see what error the script gives if it quits there.

Let me know if it helps, there's nothing worse than an OP who gives no feedback when I try to help...

Jared
Aug 17 '07 #2

pbmods
Expert 5K+
P: 5,821
Heya, Jared.

lol Yeah, yeah. I'll let you know :P

So what you're saying is that in ASP, the on error line is kind of like a try ... catch?
Aug 17 '07 #3

jhardman
Expert 2.5K+
P: 3,405
Heya, Jared.

lol Yeah, yeah. I'll let you know :P

So what you're saying is that in ASP, the on error line is kind of like a try ... catch?
sort of, but much less useful. All it says is "if you get an error, don't stop." Then when you display the error sometimes it is not the same as you would get if you just let the run-time error come up and stop the script.

Jared
Aug 17 '07 #4

pbmods
Expert 5K+
P: 5,821
Thanks for the responses.

I guess, despite the weird error, the code actually WAS working because the client says he's been getting emails. Except now the problem is that some of the form fields are coming up blank.

Of course, when I change the 'to' email address in the code above to MY email address, I don't get ANY emails.

*sigh*

Why do people use ASP, again?
Aug 21 '07 #5

pbmods
Expert 5K+
P: 5,821
Heya Jared.

The positioning of the on error line is odd. It suggests that the script is creating the mail object just fine, populating the different attributes, but then fails during the send command. This suggests to me that the bamboo mailer is not able to send email. Is it failing in other applications as well?

You should be able to print out the error message, it's err.message or err.name or some such. It is also informative at times to comment out the on error line to see what error the script gives if it quits there.

Let me know if it helps, there's nothing worse than an OP who gives no feedback when I try to help...
I commented out the 'on error'-related lines, and got no errors. And no email.

[EDIT: No wait. There it is. Ok, so it looks like that's not the problem.

Ok, so there was a misspelling that was causing one of the fields not to show up. I sure hope that wasn't the big bug that the client was all worried about (or maybe I do).... We'll see what develops.]
Aug 21 '07 #6

jhardman
Expert 2.5K+
P: 3,405
Why do people use ASP, again?
Well, ASP used to be something like PHP, but microsoft's flawed implementation of someone else's better idea. A lot of really obvious capabilities weren't included automatically and so it was a bit tiresome, but you did actually code everything by hand and that gave the programmers a lot more power. Now M$ is phasing it out in favor of .NET and I am thinking of switching over to PHP... I was never a microsoft devotee.

Glad you got it working, though.

Jared
Aug 21 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.