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 August 9th, 2004, 03:08 PM
Authorized User
 
Join Date: Jan 2004
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default php mail() problems

Hey folks,

I am new to php coding and i have problem which has stumped me:

I am trying to create a feedback form using the following code:

HTML:

<BODY>
<form action="require_files/feedback.php" method = "post">
Name: <input type="text" name="username" size"30" />
<br><br>
Email: <input type="text" name="useraddr" size="30" />
<br><br>
<textarea name="comments" cols="30" rows="5"></textarea> <br />
<input type="submit" value="send form">
</form>

and using the following PHP code:

<?php
#php script to send prayer requests

$to = "[email protected]";

$re = "testing website emails";

$msg = $_POST[comments];

mail($to, $re, $msg);

?>

<html>
<head>
</head>
<body>
thanks for your comments
<br><br>
</body>
</html>

But I keep getting te follwoing error:

Warning: mail(): SMTP server response: 550 5.7.1 Unable to relay for [email protected] in C:\Inetpub\wwwroot\FirstChurch\require_files\feedb ack.php on line 10

I am using IIS 5.1 (yes, yes I know apache would be better for type of thing!!) and i have enabled the php.ini file accordingly I think

php.ini:

; For Win32 only.
SMTP = localhost ; for Win32 only
sendmail_from= smtp.freeserve.com ; for Win32 only

; For Win32 only.
;sendmail_from = [email protected]

Any ideas and suggestions will be much appreicated! Many thanks!

Morris


 
Old August 9th, 2004, 03:55 PM
Authorized User
 
Join Date: Sep 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

make sure IIS security is set to allow relay. this is set in the properties of the default mailer.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Send mail and attachments with PHP mail function Lofa Beginning PHP 1 June 2nd, 2008 03:24 PM
problems sending mail with java mail gandacuboy J2EE 2 December 20th, 2006 03:05 PM





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