Jump to content

Mail Function


3s2ng

Recommended Posts

Hello Freaks,

I'm having problems using the mail funtion.

I want to send an html email to my user.

Here is my header and the mail code

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: $admin_email\r\n";

        mail("$to",$subject,$str_message,$headers);

Is there something wrong on my code? When I run the above code It will send an email but the problem is the body of email look like this

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

From: [email protected]

This is the body.
[/code]

And the from field is "unknown sender"

What is wrong?

Hope you can help me.

THanks
MARK
Link to comment
https://forums.phpfreaks.com/topic/22901-mail-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.