Wrox Programmer Forums
|
ASP CDO As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP CDO section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 22nd, 2004, 04:34 PM
Authorized User
 
Join Date: Mar 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to stellabantug
Default

Should I then replace the :

If Trim(Request.Form("VPEmail"))<>"" Then
   strBody = strBody & "VP's Email: " & Request.Form("VPEmail") & "@advocatehealth.com" & Chr(13)
End If

with:

If Request.Form("VPEMail") & "" <> "" Then
  strCc=Request.Form("VPEMail") & "@advocatehealth.com"
Else
  strCc = ""

End If


OR should i just add onto it????


 
Old March 22nd, 2004, 04:47 PM
Authorized User
 
Join Date: Mar 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to stellabantug
Default

Also, before I forget, how do I fix that error message that I get from time to time whenever I hit the submit button right after just submitting the form. Again,, the error message is as follows:

Provider error '80004005'

Unspecified error

/OnlineForm/Email1.asp, line 71


 
Old March 22nd, 2004, 04:51 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Well, take some time to think about it. I'll be more than happy to answer these kind of questions for you here, but the ability to analyze and understand your own code really improves your skills as a programmer, don't you think? I have found that walking away from the computer, with a pen and a piece of paper, always helps me to understand what I am doing better. Take some time to draw a small diagram of your application. Write out some If Then Else forks and decorate them with some pseudo code.



....



....



....



....



....



OK, by now you probably figured out that those two parts really have nothing to do with each other. One deals with the (free format) body text for the message, the other deals with the CC field. But you probably also figured out that they are related to each other as well.

In both cases, you are looking at VPEmail to find out if it is not a zero length string (ZLS) and act accordingly.

If it is a ZLS, you can basically ignore anyhthing to do with that field and go on. If it is not a ZLS, you want to append something to the strBody variable AND create a valid e-mail address.

With this knowledge, combining the code is easy now:
Code:
If Trim(Request.Form("VPEmail")) & "" <> "" Then
  strBody = strBody & "VP's Email: " & Request.Form("VPEmail") & "@YourEmailAddressHere.Com" & Chr(13)
  strCc = Request.Form("VPEMail") & "@YourEmailAddressHere.Com"
Else
  ' There may be no need to to reset this variable to ""
  ' I do this anyway, so I am sure I can compare it against ""
  ' later when assigning the Cc field.
  strCc = ""
End If
Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old March 22nd, 2004, 04:53 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Re: error message: I have no idea. Search Google for 80004005 and see what it comes up with.
Looks like a mail server issue to me....

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old March 22nd, 2004, 05:40 PM
Authorized User
 
Join Date: Mar 2004
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to stellabantug
Default

Imar-

This works now thanks to you. I am really not a programmer but I agree in that I need to learn
more about this.

I will research on the unspecified error message. However, I need one last bit of help from you.
It seems like the Chr(13) which is supposed to be a carriage return does not work on my email
confirmation.

My code is as follows:

strBody="The following information was submitted:" & Chr(13) & Chr(13)


If Trim(Request.Form("Contact_FullName"))<>"" Then
   strBody = strBody & "Requestor's Name: " & Request.Form("Contact_FullName") & Chr(13)
End If

If Trim(Request.Form("Site"))<>"" Then
   strBody = strBody & "Site: " & Request.Form("Site") & Chr(13)
End If


And this goes on to the last field.

My email confirmation looks like this:

The following information was submitted:Requestor's Name: testingSite: testing
Requestor's Email: [email protected]riority: LowResearch needed by: 02/20/2004
Prospect Name: testingPast Giving: YesResearch needed for: Preliminary Evaluation
Prospect's Moves Management Status: IdentificationInformation you would like to obtain: testing
Thank you for submitting your data.

I know this shouldve had a carriage return but somehow it is not working.

ONE LAST HELP PLEASE!!!



 
Old March 22nd, 2004, 05:49 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Does your e-mail program use HTML mail? In that case, you may need to use the function that converts the line breaks to HTML <br> tags as well, just as you did when you displayed the results on the page using Response.Write.

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old March 22nd, 2004, 05:57 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It suddenly occurred to me that for Windows you probably need a line feed and carriage return combination. So, replace each Chr(13) with Chr13 & Chr(10).

Much better, IMO, is to use the built-in constant vbCrLf.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
line breaks mister_mister XSLT 14 March 17th, 2008 12:55 PM
How to do line breaks! Apocolypse2005 Beginning VB 6 2 December 11th, 2006 03:20 PM
Line breaks question gkirk Beginning PHP 2 February 27th, 2005 10:40 AM
line breaks in MySQL field? Tachyon PHP Databases 3 May 21st, 2004 06:03 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.