Jump to content

Archived

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

ineedprofesionalhelp

i have issues, email

Recommended Posts

Hello !
I am a so called noobie in php scripting so I will appreciate any help I get. I am using a verry simple php script to send emails but the emails arrive in the junk folder. I know that its not from my smtp. I used my ISP smtp, please HELP.
Thanks.

<?php
$to = "what@ever.com";
$subject = "ineedhelp.";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$message = "<html><body>";
$message .= "<h1><b>It arrives in junk!</b></h1>";
$message .= "</body></html>";

if ( mail($to,$subject,$message,$headers) ) {
echo "The email has been sent!";
} else {
echo "The email has failed!";
}
?>

Share this post


Link to post
Share on other sites
The $headers variable should contain the "From:" header.

Try this:
[code]<?php
$headers = "Your Name <youremailaddress@your.domain>\r\n"
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
?>[/code]

Ken

Share this post


Link to post
Share on other sites

×

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.