SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast earph's Avatar
    Join Date
    May 2004
    Location
    Austin
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Putting "From" in the Header?

    I have this header here, but I'm having problems putting the "From" in it. Right now when it responds it puts "Apache" in the "from" section of the email.
    $headers = "Content-Type: text/html\n\n";
    I'd like to use "$name" for the "from" section. What is the proper way to code this?

    Thanks!

  2. #2
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,424
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    Try:
    Code:
    $headers .= "From: \"John Conde\" <john@conde.com>";

  3. #3
    SitePoint Enthusiast earph's Avatar
    Join Date
    May 2004
    Location
    Austin
    Posts
    54
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But I want to use the data from the $name field.

    I tried something like this, but it's messing everything up.

    $headers = "From: $name; Content-Type: text/html\n\n";

  4. #4
    SitePoint Member FreMEliCa's Avatar
    Join Date
    Jun 2003
    Location
    Canada
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't have just name, you have to supply an email address too (see stymiee's code). And the content-type header should come first.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •