Click to See Complete Forum and Search --> : Mail function and PHP
I want to use the mail function to send mail on PHP. I already set up the ini file and here is what it looks like:
[mail function]
; For Win32 only.
SMTP = relay.furman.edu
That SMTP server is correct, but it give me a server error. Its not my code either because it gets parsed without an error. I was hoping that someone else could help. Thanks
scottrtucker
07-05-2001, 01:04 AM
I just got the mail() function to work on my system (Windows2000, Apache 1.3.20, PHP 4.0.6) and it has been working fine. An example of my code is as follows:
<?php
mail ("scottrtucker@hotmail.com", "$subject", "$body", "From: $email\nX-Mailer: My PHP Script\n");
?>
$subject, $body, and $email come from an HTML form.
I would like to see your code if it is different. I don't see anything else in the setup besides the name of the SMTP server that would cause any trouble.
Hope I can be of some help,
~Scott
ame12
07-05-2001, 06:31 AM
I think that "Server error" means that you were able to connect to the SMTP server but that it denied the function. Sure you don't need to authenticate to the server to get access to send email? Or that you need to be inside their firewall to send mail? If you set up your email client to use it from the same machine, does it work?
Dave
===========================================
http://badblue.com/helpphp.htm
Free small footprint web server for Windows
PHP, file-sharing, Access/Excel transcoding
===========================================
I have a similar problem with configuring my mail() function. Here is how it is laid out on a win2k server running IIS.
[mail function]
; For Win32 only.
SMTP = mail.homepipeline.com ; for Win32 only
and the code runs like this
mail($toaddress, $subject, $mailcontent, $fromaddress);
all the variables come from a form, I have tried these same settings on a different server (linux) and it seems to run smoothly. If anyone has any suggestions I would greatly appreciate it
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.