PDA

Click to See Complete Forum and Search --> : [RESOLVED]php email


samsyl
Jun 16th, 2009, 11:08 AM
i m trying to send a simple email from php. it says email sent but i m not receiving any email ..

here is my full code


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>huntandblake.co.uk</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>

<?php
if(mail('istiaquechoudhury@hotmail.co.uk','hi','Shanti Nai'))
{
echo('Email sent ..');
}
else
{
echo('Error sending email ..');
}
?>

</BODY>
</HTML>

SambaNeko
Jun 16th, 2009, 11:44 AM
Simplistic suggestions first: have you tried looking for the email in your Junk folder? Have you tried sending to a different email?

One problem I've had with PHP mail() is that the SMTP server I was using required authentication, which is not inherently supported by mail(). So, I used the PHPMailer class (http://phpmailer.codeworxtech.com/) to get it working. Don't know if that's your problem though - check with your host.

LingoOutsider
Jun 17th, 2009, 08:23 AM
this edited code worked for me..?

$to="istiaquechoudhury@hotmail.co.uk";
$subject="";
$message="hi";
$headers="Shanti Nai";

$sent = mail($to, $subject, $message, $headers) ;
if($sent)
{print "Sent successfully"; }
else
{print "We encountered an error sending"; }


I found this site good...
http://www.w3schools.com/PHP/func_mail_mail.asp
It even gives you (limited) info on how to lay out you email /n

If anyone knows how to do a 'send page to friend' script i could do with some help.
I have a php generated page and I'm looking to email it to other people.

thanks

samsyl
Jun 18th, 2009, 04:05 AM
thanks all of u for reply. problem was HOTMAIL. i tried few of hotmail account but didnt work. but its working with my bt account. thanks