I want an email application using php.
The code is like this.

<?php

$to = "example@mail.com";
$subject = "My subject";
$txt = "Hello world!";
$headers = "From: [email]abc@rediff.com[/email]" . "\r\n" .
"CC: [email]abc@rediff.com[/email]";
mail($to,$subject,$txt,$headers);
?>

but an error has occured
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\mail.php on line 28

Recommended Answers

All 2 Replies

go into the php.ini file and change the smtp host to your isp's smtp address.

I have another doubt about how to set up an smtp server

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.