Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 13th, 2009, 06:31 AM
Authorized User
 
Join Date: Jun 2009
Posts: 12
Thanks: 0
Thanked 1 Time in 1 Post
Default Send Email from a PHP Script Example

Hi,
The first argument to this function is the recipient, the second specifies the message's subject and the third one should contain the body. So to send a simple sample message, we could use:

<?php
$to = "[email protected]";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>

---------------------

Thanks & regards
Lokananth
Live chat By miOOt





Similar Threads
Thread Thread Starter Forum Replies Last Post
send variables from a PHP script..... ethantinder Beginning PHP 2 June 23rd, 2008 02:45 PM
Need to send email garrettbrennan Visual C++ 0 September 13th, 2007 12:24 PM
how to send email in php? j4uk3n PHP How-To 4 November 25th, 2006 02:06 AM
how to create an email id through php script manu_mcs Pro PHP 0 December 8th, 2003 03:33 PM
Call and run CGI script from a PHP script ... how? dbruins BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 June 10th, 2003 03:09 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.