NYCPHP Meetup

NYPHP.org

[nycphp-talk] How to override header info in mail

Sterling Hughes sterling at bumblebury.com
Sat Nov 30 14:13:41 EST 2002


> I am using this line:
> 
> if (!mail($to, $subject, $body, "From: " . $from . ";" . header("Content-type " . $contentType))) {..}
> 
> to use the mail() function in PHP to send simple text/plain or text/html email.  However, upon attempting to send I get a warning message indicating that header information has already been set prior to emailing.  
> 
> Is there a way to overwrite only certain header information prior to emailing to ensure the content-type of the email being either text/plain or text/html?
>

you shouldn't be calling the header function - header() is meant to 
set HTTP Headers (also, mail headers are not delimited by a semi-colon, 
but by carriage return, newline).

-Sterling


> Just wondering
> Thanx
> Phil
> 
> 
> 
> --- Unsubscribe at http://nyphp.org/list/ ---
> 
> 



More information about the talk mailing list