...

View Full Version : Email script



alcool9999
09-13-2009, 04:04 PM
Hi i have this php mail script and it says message sent successfuly but i never recieve the message.
any help apreciated.

i know my email address needs to go where "you@someone.com" is so thats not the problem.
code:

<?php
$to = "you@someone.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>

macpeace
09-13-2009, 04:53 PM
Hi;

I use this and it works fine....


<?
$recipient = "yourmail@else.com";
$subject = "Hi";

$mssg = "
$mssg .= "the message\n";
$mssg .= "";

mail($recipient, $subject, $mssg, $mailheaders) or die ("Could't send message");
?>

<?
echo "Sucess";
?>

SKDevelopment
09-13-2009, 06:46 PM
<?php
$to = "you@someone.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>
This your script worked form me too. I have sent an e-mail to my gmail e-mail address. I have received it but found it in the "Spam" folder. I think probably because "From" and "Reply-To" headers have been absent. Or maybe the message has been too short.

Anyway, if you have a spam-filter, I would check if it did not cut the message ... It could be quite probable that the message is sent but you do not see it due to a spam filter... At least the script worked for me in this way.

clunk.werclick
09-13-2009, 06:57 PM
If you suspect it may be being blocked by anti-spam feel free to fire it to me at:

cf13092009@wibblywobblyteapot.co.uk

Make a note of the time when you do it, and I'll tell you if it's getting killed by something like an RBL or Spamassassin based device.

I love spam myself, I just don't get it any more :-)

jegan2k9
09-17-2009, 08:59 AM
Hi alcool9999,

This may script may help you,
Use this and try ,

$mail_to="to@example.com";
$mail_from = "from@example.com";
$mail_sub = "sample"; // The Subject of the email
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: $mail_from";
$mail_mesg ="some text ";
mail($mail_to,$mail_sub,$mail_mesg,$headers);

You have not mentioned the header in the parameters.

Thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum