PHP Mail

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
navaneeth
Forum Newbie
Posts: 3
Joined: Sat Jan 21, 2006 11:25 pm
Contact:

PHP Mail

Post by navaneeth »

Hello

I couldn't send mail with this script..I am not getting any errors..But the mail is not coming ? Please explain..

Code: Select all

$mailto = 'jstgermain@methodcomptech.com' ; 

$subject = "MCT Web Mail" ; 

$formurl  = "http://www.methodcomptech.com/methodemail.html" ; 
$errorurl  = "http://www.methodcomptech.com/error.html" ; 
$thankyouurl = "http://www.methodcomptech.com/success.html" ; 

$name = $_POST['name'] ; 
$email = $_POST['email'] ; 
$phone  = $_POST['phone'] ; 
$website =  $_POST['website'] ; 
$comments = $_POST ['comments'] ; 
$http_referrer = getenv ( "HTTP_REFERER" ); 

if (!isset($_POST['email' ])) { 
    header( "Location: $formurl" ); 
    exit ; 
} 
if (empty( $name) || empty($email) || empty($comments)) { 
    header( "Location: $errorurl" ); 
   exit ; 
} 
if (get_magic_quotes_gpc ()) { 
    $comments = stripslashes( $comments  ); 
} 

$messageproper = 

    "This message was sent from:  " .  $name .  
    "\n$http_referrer\n\n" . 
    "________________________( COMMENTS )________________________\n\n"  . 
    "\nName:  " . $name . 
     "\nE-Mail:  " . $email . 
    "\nPhone Number:  " .  $phone . 
    "\nWeb-Site:  " . $website  . 
    "\n\nMessage:  \n" . $comments . 
    "\n\n____________________________________________________________\n"  ; 

mail ($mailto, $subject, $messageproper,  "From: \"$name\" <$email>\nReply-To: \"$name\" <$email>\nX-Mailer: feedback.php" ); 
header ( "Location: $thankyouurl" ); 
exit ;
please tell me some easy ideas to send mail from a php page. Is it needed to import any other classes ?

Navaneeth
User avatar
raghavan20
DevNet Resident
Posts: 1451
Joined: Sat Jun 11, 2005 6:57 am
Location: London, UK
Contact:

Post by raghavan20 »

Use PHPMailer class from SourceForge.
If you have any specific error messages in your code, please post them.
fine
Forum Newbie
Posts: 5
Joined: Thu Oct 13, 2005 4:15 pm

Post by fine »

You miss "\r" in your code.

Please see this tutorial send mail in php
Post Reply