Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old December 29th, 2006, 01:46 AM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default sending mail

<?php $to = "mgnishanthan@missioncode.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "nisanth_2001@yahoo.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";?>

i try to send mail using this code but i got error like this,anyone help plz..

Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for mgnishanthan@missioncode.com in c:\inetpub\wwwroot\mail.php on line 6
Mail Sent.


  #2 (permalink)  
Old December 29th, 2006, 06:19 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: colombo, WP, Sri Lanka.
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hai,
i think you are using localhost, if you are using localhost, just activate your SMTP service.

surendran
(Anything is Possible)
http://ssuren.spaces.msn.com


Similar Threads
Thread Thread Starter Forum Replies Last Post
mail sending PHP FAQs 0 April 2nd, 2007 06:43 AM
problems sending mail with java mail gandacuboy J2EE 2 December 20th, 2006 03:05 PM
sending mail anita VB How-To 3 September 30th, 2004 03:48 PM
Sending e-mail to different mail box! Calibus Classic ASP Databases 4 September 3rd, 2004 05:48 PM
Sending both text mail and HTML mail - CDONTS madhukp Classic ASP Basics 1 October 8th, 2003 01:05 AM





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