Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Apr 2007
    Posts
    144
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Mail Function showing header info

    I am using a standard mail function within an AMFPHP Class that i have used many times. Now, when i use it it does not work right. When a mail is sent, the $header info and html shows in the email.

    I would like to know why the header info is showing in the email, along with why the HTML code is not rendering. I will post examples of code and result. Please provide a solution b4 i pull my hair out.

    Running PHP 4.3.9 on Apache

    PHP Code:
    function sendMail($vars) {

    $email "visitor@site.com";

    $headers  ="MIME-Version: 1.0\r\n";
    $headers .= "From: {$email}\r\n";
    $headers .= "Return-Path: {$email}\n";
    $headers .= "Reply-To: {$email}\n";
    $headers .= "Message-Id: <".time()."@".$_SERVER['SERVER_NAME'].">\n";
    $headers .= "X-Mailer: php-mail-function-0.2\n";

    $content "<b>test</b>";

    mail("email@example.com""Subject"$content$headers);

    This is the email that is returned.
    Code:
    From: visitor@site.com
    Reply-To: visitor@site.com
    Message-Id: <1185426433@www.example.com>
    X-Mailer: php-mail-function-0.2
    
    <b>test</b>
    Last edited by cesarcesar; 07-26-2007 at 06:24 AM.

  • #2
    Regular Coder
    Join Date
    Apr 2007
    Posts
    144
    Thanks
    5
    Thanked 0 Times in 0 Posts

  • #3
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    Were you testing by sending to a GMail account? I'm pretty sure they are one of the sites that appends /r to the before any /n.
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.


  •  

    Posting Permissions

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