PHP mail() not sending

Status
Not open for further replies.

bonzo meier

Member
Messages
47
Reaction score
0
Points
6
hi,

I wrote a script that is supposed to send data from a html-form to an email-recipient. it works fine on php5, but on a win-server with php4 it doesn´t.

here´s the script:

Code:
$mailto    = "mail@domain.com";
$from_subject = "blabla";
// the $_POST is coming from the form
$headers = "From: " . $_POST['EMAIL'] ."\n";
$headers .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n";
$headers .= "Content-Transfer-Encoding: 8bit\r\n";


if (@mail($mailto, $from_subject, "Bonzo loves you!", $headers)) {
            $send_msg = "mail has been sent";
else $send_msg ="no mail, sorry!";

now I keep getting the $send_msg "mail has been sent" while nothing arrives...
anyone knows what´s wrong?

peace, bonzo
 

taekwondokid42

New Member
Messages
268
Reaction score
0
Points
0
There is a possibility that it is not being sent because the servers are up and down all of the time.

There is also a possibility that you do not have a high enough php level (I think you need to be lvl 2 for this script, upgrade at x10hosting.com/account)

There might also be something wrong with your script. I have never seen a mail() function written out like that. If it is not one of the first two, try this:

<?php

$to = "someperson@someplace.com";
$subject = "some subject";
$message = "some message!";
$headers = "From: thesuperdude@someplace.com";

mail($to,$subject,$txt,$headers);
?>
 

sunils

New Member
Messages
2,266
Reaction score
0
Points
0
Hi,

my version of email coding is

Code:
$to = "To Address";
$senderemail = "Sender Address";
$subject = "Subject";
$message = "Message"; 
$headers = "MIME-Version: 1.0\r\n";
$headers.= "Content-Type: text/html;";
$headers.= "Charset=iso-8859-1\r\n";
$headers.= "From: ".$senderemail;
mail($to, $subject, $message, $headers);


Try this

Sunil Sankar
------------------------
http://www.sunils.co.cc
http://sunilstech.blogspot.com/
 
Status
Not open for further replies.
Top