I am PHP newbie. I had installed XAMPP on my system and wants to send a test mail. I had done the following changes to php.ini
Code: Select all
[mail function]
; For Win32 only.
SMTP = localhost
;SMTP = 10.0.2.211
;smtp_port = 25
smtp_port = 80
; For Win32 only.
;sendmail_from = me@example.com
sendmail_from = arpit_gadle@yahoo.co.in
Code: Select all
<html>
<head>
<title>Email In PHP</title>
<?
//syntax for sending mail
/*
mail(to,subject,message,headers,parameters)
*/
?>
</head>
<body>
<center>
<h1>Email In PHP</h1>
<h4>
<?
$to="gadle.arpit@gmail.com";
$subject="Test Mail";
$message="This is a test mail sent from application runnuing locally on XAMPP";
$from = "arpit_gadle@yahoo.co.in";
$headers = "From: $from";
if(mail($to,$subject,$message,$headers))
{
echo "Mail Sent";
}
else
{
echo "Mail Not Sent";
}
?>
</h4>
</center>
</body>
</html
Thanks
Arpit