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 January 6th, 2006, 11:07 AM
Registered User
 
Join Date: Jan 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Got problems with sending email using php HELP

hi everyone

when i send an email, i did a condition,
if(mail($recipient,$subject,$message))
         echo nl2br("<b>Message Sent:</b>
         To: $recipient
         Subject: $subject
         Message:
         $message");
else
         echo nl2br("Error");

the codes goes to the message send condition state all the parameter correctly. But actually i need not receive the email. what could be the problem? or is there anyting wrong with my coding?

$name=$_POST['customerName'];
$email=$_POST['email'];
$comments=$_POST['customerFeedback'];

//Declare the variables
$recipient = "[email protected]";
$subject = "PEM Feedback Form, From: $name";
$message = " Name:$name \n Email: $email \n Comments: $comments";

//mail() function sends the mail
if(mail($recipient,$subject,$message))
echo nl2br("<b>Message Sent:</b>
         To: $recipient
         Subject: $subject
         Message:
         $message");
         else
         echo nl2br("Error");

?>

i stuck for quite long le. can anyone help?

thanks in advance.


 
Old January 6th, 2006, 03:37 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

Here is the detailed examples for beginners.

`~@#\^%&*/\.<.\/-|+|_!:;..=?>
Students' finances
 
Old January 8th, 2006, 01:07 AM
Registered User
 
Join Date: Jan 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi
 thanks alot. but i its still not working, what could be the problem?

 
Old January 8th, 2006, 10:23 AM
Friend of Wrox
 
Join Date: Dec 2004
Posts: 154
Thanks: 0
Thanked 0 Times in 0 Posts
Default

<?php
$headers = 'From: [email protected]' . "\r\n";
$headers.= "MIME-version: 1.0\n";
$headers.= "Content-type: text/html; charset= iso-8859-1\n";

$message = "This is a Test Email\n";
$useremail = $recipient;
mail($useremail,'title', $message, $headers);
?>





Similar Threads
Thread Thread Starter Forum Replies Last Post
System.Net.Mail Problems With Sending An Email Doom C# 3 May 25th, 2008 02:49 PM
problems with sending email starfish2007 Pro PHP 0 June 6th, 2007 11:30 PM





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