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

    Join Date
    Jul 2000
    Posts
    45
    Rep Power
    14
    I'm using the mail command to mail off some messages. I want from to say "John Doe". So I do this:
    $to="me@me.com";
    $subject="Me";
    $message="More me";
    $headers="From: John DoenReply-To: john@doe.comnX-Mailer: PHP/" . phpversion();
    mail("$to","$subject","$message","$headers");

    However, when the mail arrives in my mailbox, the from field reads: "John.Doe@thisaddress.com" where thisaddress is the long server address of the webserver. My question is can I get the from field to appear without the @thisaddres.com anywhere in there? I'm not sure if this is possible, but I think it should be so I'm hoping. Thanks in advance.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    24
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by polman:
    I'm using the mail command to mail off some messages. I want from to say "John Doe". So I do this:
    $to="me@me.com";
    $subject="Me";
    $message="More me";
    $headers="From: John DoenReply-To: john@doe.comnX-Mailer: PHP/" . phpversion();
    mail("$to","$subject","$message","$headers");
    [/quote]

    I not an expert but i think if you chage the from header to read
    From: John Doe<john@doe.com>

    rather then

    From: John Doe

    It should come out like you want it

Similar Threads

  1. Replies: 4
    Last Post: May 13th, 2009, 07:03 AM
  2. Help with script
    By akastarlight in forum Perl Programming
    Replies: 1
    Last Post: February 6th, 2004, 06:55 AM
  3. mail() not working with ISP's mail server
    By wjones8050 in forum PHP Development
    Replies: 2
    Last Post: January 9th, 2004, 02:47 PM
  4. Replies: 1
    Last Post: November 18th, 2003, 09:59 AM
  5. php mail() very slow (pipe command and freebsd 5.1)
    By ddalton in forum PHP Development
    Replies: 0
    Last Post: October 30th, 2003, 02:37 PM

IMN logo majestic logo threadwatch logo seochat tools logo