Hi I am new to Php.. i want to know how mailto script works in php .. and can any one pls provide a script for that..
+6
A:
It's actually very simple: Just use php's "mail" function. See:
http://php.net/manual/en/function.mail.php
It's as easy as typing
mail($to, $subject, $message, "From: [email protected]");
This returns a boolean so you can check to see if it was sent successfully (it will be, unless your server's mail system is misconfigured) by doing something like:
$success = mail([...]);
if ($success)
echo "your message was sent successfully";
else
echo "your message did not send for some reason :(";
or even just
if (mail([...]))
echo "success";
else
echo "failure";
Mala
2010-01-07 07:36:50
+2
A:
Of course the easiest way to do it is using PHP's mail() command but it is not particularly efficient. The PEAR Mail Package is a good option or you can use a PHP class. (You can find loads on PHP Classes.)
Chaim Chaikin
2010-01-07 10:44:06
+1
A:
To save a lot of heartache, use something like SwiftMailer.
Blair McMillan
2010-01-07 10:45:43