52 users online (1 members and 51 guests)  

Thread: cgi confusion


Page 2 of 2 First 1 2
  Results 16 to 28 of 28

Related

  1. Coding Confusion    Forum: PHP Forum
    Replies: 5
  1. #16
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Oh, and if you are not getting any errors, try turning off "Show Friendy HTTP errors" in Internet Options, Advanced.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  2. #17
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    Is this a paid host right? You can't be paying much if they don't support CGI... Even many free hosts support that.

  3. #18
    Enigma's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Nov 2000
    Posts
    426
    My guess is that this is a Windows host; hence, the use of ASP instead of the *nix CGI.

  4. #19
    Carolynne's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Shingle Springs, CA
    Posts
    11

    close, but not quite

    Okay, the script is working...sort of.

    When I click on the submit button, I am redirected to the proper page, and I do get an email but it is blank. I filled out my form and sent it to myself, but none of the information came through. I also wanted to put something in the subject line, but that isn't working either.

    Here is the code again:

    <html>

    <head>
    <title>Thank You</title>
    </head>
    <body>
    <p align="center"><p>&nbsp;</p><p>&nbsp;</p><p align="center">
    <font face="Verdana, "Trebuchet MS", Arial, sans-serif" size="2">Your information has been sumbitted.</font></p>
    <%
    FirstName = Request.Form("FirstName")
    LastName = Request.Form("FirstName")
    City = Request.Form("City")
    State = Request.Form("State")
    Phone = Request.Form("Phone")
    SenderEmail = Request.Form("email")
    bagged_shavings = Request.Form("bagged_shavings")
    BaggedShavingsPrice = Request.Form("BaggedShavingsPrice")
    bulk_shavings = Request.Form("BulkShavingsPrice")
    straw = Request.Form("straw")
    StrawPrice = Request.Form("StrawPrice")
    rice_hulls = Request.Form("rice_hulls")
    RiceHullsPrice = Request.Form("RiceHullsPrice")
    other = Request.Form("other")
    OtherBedding = Request.Form("OtherBedding")
    OtherPrice = Request.Form("OtherPrice")
    StallCount = Request.Form("StallCount")
    BeddingPerWeek = Request.Form("BeddingPerWeek")
    textfield = Request.Form("textfield")


    Set JMail = Server.CreateObject("JMail.SMTPMail")

    ' Below you should enter your own SMTP-server
    JMail.ServerAddress = "my SMTP-server"

    JMail.Sender = Senderemail
    JMail.Subject = BeddingCostAnalysisRequest

    JMail.AddRecipient "caspixel@yahoo.com"

    JMail.Body = Body

    JMail.Priority = 1

    JMail.AddHeader "Originating-IP", Request.ServerVariables("REMOTE_ADDR")
    JMail.Logging = True
    JMail.Execute

    %>
    <center>

    By the way, Enigma is right, it is a Windows host, or at least, my account is considered a Windows account.

  5. #20
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Ahha.

    Code:
    JMail.Body = Body
    Herem you are setting the body of the email. the variable Body, however, has not been set at all. Therefore, blank email.

    You need to build your email body using the variables you have set above, a small example -

    Code:
    Body = "First name: " & FirstName & chr(10)
    Body = Body & "Second Name: " & LastName & chr(10)
    etc etc. basically, build the email body using your variables, and it should work
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  6. #21
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    By the way, chr(10) is a newline. Works fine in plain text emails.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  7. #22
    Carolynne's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Shingle Springs, CA
    Posts
    11

    getting closer

    Thanks so much. I know I am getting closer to having this thing work. I am not quite clear on exactly how to write the code though.

    I used this code first:
    _________________________________________________________________________________

    JMail.Body = Body = "First name: " & FirstName & chr(10)
    JMail.Body = Body & "Last Name: " & LastName & chr(10)
    JMail.Body = Body & "City: " & City & chr(10)
    JMail.Body = Body & "State: " & State & chr(10)
    JMail.Body = Body & "Phone: " & Phone & chr(10)
    JMail.Body = Body & "email: " & email & chr(10)
    JMail.Body = Body & "bagged_shavings: " & bagged_shavings & chr(10)
    JMail.Body = Body & "BaggedShavingsPrice: " & BaggedShavingsPrice & chr(10)
    _________________________________________________________________________________
    and sent myself some information. All I got was BaggedShavingsPrice in the body of the email though.

    then I tried this code:
    ____________________________________________________________________________________

    JMail.Body = Body = "First name: " & FirstName & chr(10)
    Body = Body & "Last Name: " & LastName & chr(10)
    Body = Body & "City: " & City & chr(10)
    Body = Body & "State: " & State & chr(10)
    Body = Body & "Phone: " & Phone & chr(10)
    Body = Body & "email: " & email & chr(10)
    Body = Body & "bagged_shavings: " & bagged_shavings & chr(10)
    Body = Body & "BaggedShavingsPrice: " & BaggedShavingsPrice & chr(10)
    ___________________________________________________________________________________

    But then all I got was "False" in the body of the email.

    There must be a variation that I am missing. I am sure it is simple and obvious and I am just that thick.

    I am excited that I am at least getting something now.

    Another thing, how do I get a subject line to show up. It is still showing up as subject "none".

  8. #23
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    You were almost right in the first example.

    the ampersand (&) is concatenating the string together. basically, we are saying that Body is equal to what Body already is, plus "whatever" on the end.

    Replace
    JMail.Body = Body = "First name: " & FirstName & chr(10)

    with

    Code:
    JMail.Body = Jmail.Body & "First name: " & FirstName & chr(10)
    you dont want two = signs, you want to concatenate.

    Replace Body with Jmail.Body in the other lines and it should work. *fingers crossed*
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  9. #24
    Carolynne's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Shingle Springs, CA
    Posts
    11

    party time!

    It works!!!

    Now, just one more order of business. I would like to have some text show up in the subject line when it gets emailed to me. I did enter some text where I thought it should go in the code:

    JMail.Subject = BeddingCostAnalysisRequest

    but the email is coming in with [none] in the subject area. Do you know how to fix this?

    Also, I can't tell you how much I appreciate your help QuietDean. Is there a typical protocol for sending thanks? Your help has really been invaluable.

    15 minutes later....

    Well it worked once, then I started getting a weird message when I tried it later. This is what appeared on after I clicked "Submit"

    Your information has been sumbitted.

    jmail.SMTPMail error '8000ffff'

    The message was undeliverable. All servers failed to receive the message

    /hheaven/woody_pet_pro/sendmail.asp, line 71

    What the heck does that mean?
    Last edited by Carolynne; 08-19-2003 at 10:12 PM.

  10. #25
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    Quote Originally Posted by Carolynne
    Is there a typical protocol for sending thanks?
    What a great time to introduce a new function in the forum.

    Notice on the bottom of each post, to the left of the "edit" button, there is a square image. By clicking this link you may vote positively or negatively. This awards points or takes points away resulting in a user "reputation" which is displayed by the green squares below the user name. When doing a mouseover on the green squares you will see a positive or negative comment.

    When you vote there is also a textbox where you can leave a brief message of thanks.

    disclaimer: I am still working on the new forum so understand this function is still pretty "raw".

    Dave

  11. #26
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Ahha.

    Any time you find a 'wierd' message, the best thing you can do with it is just paste it into google. I'm not kidding, Google is that good.

    I pasted the error, hit 'Im feeling lucky', and got this -

    jmail.SMTPMail error '8000ffff'
    The message was undeliverable. All servers failed to recieve the message

    The mailserver(s) you specified either weren't set up to receive emails from your webserver or you didn't enter a valid mailserver. You must enter the full name or IPaddress, you can't just enter the network name of your mailserver. Also, some systems prefer if you specify port, which usually is 25.
    If all that is met, it may be that your smtp server is down for some reason.

    To set the subject, just use whatever you want, eg -

    Code:
    JMail.Subject = "My Subject"
    Should work fine.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  12. #27
    Carolynne's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2003
    Location
    Shingle Springs, CA
    Posts
    11

    onto the next thing

    Does anyone know anything about HTML emails.

    I have some clients that I would like to start sending
    e-newsletters to, but I need some info on how to do the code.

    Thanks!

  13. #28
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    have a look at Jmails method list, its all there -

    http://www.juicystudio.com/tutorial/asp/jmail.html
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Page 2 of 2 First 1 2

Tags for this Thread