Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To 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 November 23rd, 2006, 02:50 AM
Registered User
 
Join Date: Nov 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to send email in php?

does anyone here know how i can send email using php language?

ps:
i do not have an smtp server(that means i have to use a free smtp server), tell me what i need to set (may it be in the php setting or may it be in the code), in order for the php to use the free smtp.
i'm a newbie in php language, so please explain it in general english, for that i said thank you

thanks in advance
 
Old November 23rd, 2006, 06:32 AM
Authorized User
 
Join Date: Sep 2006
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to aneesh_sunu@yahoo.co.in Send a message via Yahoo to aneesh_sunu@yahoo.co.in
Default

Hai
Please download "php_manual_en.chm" named php manual.
You can get it from searching with google.
This is very helpfull to you

Reagards
Aneesh
 
Old November 23rd, 2006, 06:36 AM
Authorized User
 
Join Date: Sep 2006
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to aneesh_sunu@yahoo.co.in Send a message via Yahoo to aneesh_sunu@yahoo.co.in
Default

Hai
Please check this links
http://www.smartwebby.com/PHP/emailsending.asp
http://in2.php.net/mail

Reagards
Aneesh
 
Old November 25th, 2006, 02:04 AM
Authorized User
 
Join Date: Nov 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to talk2leo
Default

Hi Dear

if you mean to send simple mail from your PHP code...as i understood your problem.....Below is the complete code...
try this link
or see the code below
//used variable in the code are from some form, you will make
//variable are editable or as much you want to create in your form
//simple mail script starts here//
<?php
echo "<p>Thank you, <b>$_POST[name]</b>, for your message!</p>";
echo "<p>Your e-mail address is: <b>$_POST[email]</b>.</p>";
echo "<p>Your message was:<br>";
echo "$_POST[message] </p>";
//start building the mail string
$msg = "Name: $_POST[name]\n";
$msg .= "E-Mail: $_POST[email]\n";
$msg .= "Message: $_POST[message]\n";
//set up the mail
$recipient = "[email protected]";
$subject = "Form Submission Results";
$mailheaders = "From: My Web Site <[email protected]> \n";
$mailheaders .= "Reply-To: $_POST[email]";
//send mail
mail($recipient, $subject, $msg, $mailheaders);
?>
//simple mail script ends here//

//mail in HTML Format starts here//
<?php
echo "<p>Thank you, <b>$_POST[name]</b>, for your message!</p>";
echo "<p>Your e-mail address is: <b>$_POST[email]</b>.</p>";
echo "<p>Your message was:<br>";
echo "$_POST[message] </p>";
//start building the mail string
$msg = "<p><strong>Name:</strong> $_POST[name]</p>";
$msg .= "<p><strong>E-Mail:</strong> $_POST[email]</p>";
$msg .= "<p><strong>Message:</strong> $_POST[message]</p>";
//set up the mail
$recipient = "[email protected]";
$subject = "Form Submission Results";
$mailheaders = "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-type: text/html; charset=ISO-8859-1\r\n";
$mailheaders .= "From: My Web Site <[email protected]> \n";
$mailheaders .= "Reply-To: $_POST[email]";
//send the mail
mail($recipient, $subject, $msg, $mailheaders);
?>

//mail in HTML Format ends here//

Regards

 
Old November 25th, 2006, 02:06 AM
Authorized User
 
Join Date: Nov 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to talk2leo
Default

or try this link.i have submittes a simple mailing script at this link below
http://programmersheaven.com/downloa.../download.aspx






Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to send email garrettbrennan Visual C++ 0 September 13th, 2007 12:24 PM
How to send email abiye49 Excel VBA 1 January 10th, 2007 03:32 PM
To send an email Danny_n BOOK: Excel 2003 VBA Programmer's Reference 0 January 12th, 2005 08:33 AM
Send email Danny_n BOOK: Excel 2003 VBA Programmer's Reference 0 January 12th, 2005 08:32 AM
send email X-Ken VS.NET 2002/2003 8 July 2nd, 2004 06:13 AM





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