1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Rep Power
    Here's the code I'm using.

    mail("$addresses[$index]","$Subject","$Body","From:$FromnReply-To: $From");

    This does send an email address to the correct recipient; however, the Subject, the From address, and the Reply-To address do not get included in the email header. Instead, they all show in in the email body, like this:

    Subject: Longfellow
    Reply-To: inf@danielrevelation.com

    Come wander with me, she said, into regions yet untrod, and read what is still unread in the manuscripts of God.

    (I just copied and pasted the body of the email. The actual email subject line was blank.)

    The server I'm on appears to be using PHP/3.0.12.

    I'm pretty sure the error is in the way I'm using the mail() function; however, I'm also following the directions in the DevShed tutorial, and I have even tried just copying the "working example" provided at http://www.bralp.org/devshed/ (which is where I got the above code).

    Interestingly, if I do not try to pass variables to the mail() function but use literal string values, it seems to work just fine: the subject line and the From address are what I specify. It's when I attempt to pass variables, as in the above example, that I run into problems.

    What additional details do I need to know to get this thing to work?


  2. #2
  3. No Profile Picture
    Apprentice Deity
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 1999
    Niagara Falls (On the wrong side of the gorge)
    Rep Power
    I'm not sure why this would cause the problem you are having, but it might...

    You don't need the " around the variable names in the function.

    Just do:

    mail($addresses[$index],$Subject,$Body,"From:$FromnReply-To: $From");

  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2000
    Rep Power
    Thanks for the suggestion about the quotes. I tried that first thing this morning, but it didn't make a difference.

    Other ideas?


Similar Threads

  1. Uploading Files
    By vivekjain in forum ASP Programming
    Replies: 0
    Last Post: February 16th, 2004, 11:21 PM
  2. problem with my disable function...
    By bwedekin in forum HTML Programming
    Replies: 1
    Last Post: February 9th, 2004, 11:47 AM
  3. Help with script
    By akastarlight in forum Perl Programming
    Replies: 1
    Last Post: February 6th, 2004, 06:55 AM
  4. mail() function....
    By fluke_tony in forum PHP Development
    Replies: 9
    Last Post: January 29th, 2004, 06:03 PM
  5. mail() function dropping characters
    By Webbywarehouse in forum PHP Development
    Replies: 2
    Last Post: January 28th, 2004, 01:42 PM

IMN logo majestic logo threadwatch logo seochat tools logo