+ Reply to Thread
Results 1 to 5 of 5

Thread: PHP, mail function and email headers...

  1. #1
    Junior Member
    Join Date
    Oct 2007
    Posts
    22

    Default PHP, mail function and email headers...

    Ok, new problem I discovered after moving hosts.... the php mail funtion...

    In my form I have, I'm specifying header info, such as:
    Code:
    $headers="From: $from\r\n";
    $headers.="Return-Path: <email removed for spam reasons>\r\n";
    $headers.="X-Mailer: New Member App PHP Script\r\n";
    $headers.="Cc: $cc\r\n";
    $headers.="MIME-Version: 1.0\r\n";
    $headers.="Content-type: text/html; charset=iso-8859-1\r\n";
    Then build the message content in normal HTML.

    Parse to to the mailer as
    Code:
    mail($headers,$to,$subject,$message);
    Now, when I receive the mail message to my gmail account, it looks like:
    X-Mailer: New Member App PHP Script

    Cc: <user provided email address>

    MIME-Version: 1.0

    Content-type: text/html; charset=iso-8859-1

    Message-Id: <20071017130823.9036A2EF52@web4.steadfast.net>
    Date: Wed, 17 Oct 2007 08:08:23 -0500 (CDT)



    <html>
    <body font-type='arial' font-size=10pt>
    <h3>New Dog faction Guild Member Application</h3>
    <hr>
    <p>
    It's like it's taking the info I specify as header now and placing it all as text. Anyone have any ideas? This works as intended on my last host. Is there something the PHP mailer function is doing?

  2. #2
    Happy Steadfast Client
    Join Date
    Jan 2006
    Location
    Miami, Fl
    Posts
    125

    Default

    Quote Originally Posted by PHPwebsite
    bool mail ( string $to, string $subject, string $message [, string $additional_headers [, string $additional_parameters]] )
    http://us.php.net/function.mail
    [ JUSTIN ]
    [ justechnology llc ]
    [ WEB DESIGN / DEVELOPMENT, TECHNICAL CONSULTING, & BUSINESS WEB HOSTING
    ]
    [ when will apple? ]
    [ GUESS THE RELEASE DATE AND GET THE SCOOP ON APPLE'S NEW PRODUCTS
    ]

  3. #3
    Junior Member
    Join Date
    Oct 2007
    Posts
    22

    Default

    I actually did have the "to" first, but was messing around with it. Still the same result.

    Like I said, was fine when sent with the other host.

    EDIT:

    I removed the \r prior to the \n, and it cleaned the header up enough to seemingly fix it.
    Last edited by PhilW; 10-17-2007 at 10:21 PM.

  4. #4
    Happy Steadfast Client
    Join Date
    Jan 2006
    Location
    Miami, Fl
    Posts
    125

    Default

    Its always the smallest things! Glad to hear you got it working.
    [ JUSTIN ]
    [ justechnology llc ]
    [ WEB DESIGN / DEVELOPMENT, TECHNICAL CONSULTING, & BUSINESS WEB HOSTING
    ]
    [ when will apple? ]
    [ GUESS THE RELEASE DATE AND GET THE SCOOP ON APPLE'S NEW PRODUCTS
    ]

  5. #5
    Junior Member
    Join Date
    Aug 2008
    Posts
    1

    Default

    The mail() function allows you to send emails directly from a script.

    This function returns TRUE if the email was successfully accepted for delivery, otherwise it returns FALSE.

    mail(to,subject,message,headers,parameters)

+ Reply to Thread

Posting Permissions

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