-
[RESOLVED]php email
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
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('[email protected]','hi','Shanti Nai'))
{
echo('Email sent ..');
}
else
{
echo('Error sending email ..');
}
?>
</BODY>
</HTML>
-
Re: php email
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 to get it working. Don't know if that's your problem though - check with your host.
-
Re: php email
this edited code worked for me..?
PHP Code:
$to="[email protected]";
$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
-
Re: php email
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