a problem with the mail() function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I installed PHP version 5.0.3 along with Apache 2.x on
windows XP Home Edition laptop. I connect to the
internet using wireless connection (AOL ADSL Router).
I am doing a personal course work. Basically a user is
required to fill in a form with their e-mail address.
The server then is supposed to send a message to the
user.

On my script I wrote:
$from = "From: gratziale@xxxxxxxxx";
 $subject = "Confirmation";
 if(mail($email, $subject, $message, $from)){
   echo('<p class="head">
   Congratulations, you have successfully created an
account on our server. 
   However, you will need to activate your account by
clicking on the link 
   that is sent to your e-mail address. Thank
you</p>');
}
else{
    die('We are very sorry that your account can not
be created because: '. error_reporting());
}

on my php.ini, i wrote:
extension=php_imap.dll
...
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
sendmail_from = gratziale@xxxxxxxxx
...

When I tried to run the script I had the error:
Warning: mail() [function.mail]: SMTP server response:
550 Delivery is not allowed to this address.

Then I tried to install mail server (ArgoSoft Mail
Server) after I read the php tutorial since there is a
note posted to try it. I install it successfully.
Below are the steps that I took to install it

Step1:
1. Install ArGoSoft Mail Server
2. Open the ArGoSoft Mail Server and click Tools
>Options to configure.
3. Enter the DNS server name or let the ArGoSoft Mail
Server to auto-detect.
4. In the IP Homes tab, enter 127.0.0.1
5. Start (run) the ArGoSoft Mail Server and make sure
there is no error.
6. Now, the "localhost" (127.0.0.1) is your SMTP &POP3
server.
Step2:
1. Open your php.ini
2. Enter the value of SMTP like SMTP = localhost

I add the option allow relay. 

I got the mesage that the mail function on the script
was successfully executed. However, the e-mail was not
delivered as intended. Moreover, on the mail server
log, I had these errors (user enter the e-mail address
ngow8@xxxxxxxxxxx, from is set to gratziale@xxxxxxxxx)

30/04/2005 03:14:03 - [    7] Delivering to
ngow8@xxxxxxxxxxx
30/04/2005 03:14:03 - [    7] Attempting to deliver to
the domain hotmail.com
30/04/2005 03:14:03 - [    7] Retrieved 1 MX records
for domain hotmail.com
30/04/2005 03:14:03 - [    7] Trying the server
hotmail.com: 64.4.33.7
30/04/2005 03:14:03 - [    7] SMTP error relaying the
message to server hotmail.com: 64.4.33.7:
30/04/2005 03:14:03 - [    7] Trying the server
hotmail.com: 64.4.32.7
30/04/2005 03:14:03 - [    7] SMTP error relaying the
message to server hotmail.com: 64.4.32.7:
30/04/2005 03:14:03 - [    7] Server error: . Will
retry in 0 hr 1 min
30/04/2005 03:15:03 - [    8] Delivering to
gratziale@xxxxxxxxx
30/04/2005 03:15:03 - [    8] Attempting to deliver to
the domain yahoo.com
30/04/2005 03:15:03 - [    8] Retrieved 1 MX records
for domain yahoo.com
30/04/2005 03:15:03 - [    8] Trying the server
yahoo.com: 66.94.234.13
30/04/2005 03:15:04 - [    8] Fatal SMTP error
relaying the message to server yahoo.com:
66.94.234.13: 553 5.5.4 <mailer-daemon>... Domain name
required for sender address mailer-daemon
30/04/2005 03:15:04 - [    8] Trying the server
yahoo.com: 216.109.112.135
30/04/2005 03:15:04 - [    8] SMTP error relaying the
message to server yahoo.com: 216.109.112.135:
30/04/2005 03:15:04 - [    8] Server error: . Will
retry in 0 hr 1 min
30/04/2005 03:15:04 - [    9] Delivering to
ngow8@xxxxxxxxxxx
30/04/2005 03:15:04 - [    9] Attempting to deliver to
the domain hotmail.com
30/04/2005 03:15:04 - [    9] Retrieved 1 MX records
for domain hotmail.com
30/04/2005 03:15:04 - [    9] Trying the server
hotmail.com: 64.4.33.7
30/04/2005 03:15:04 - [    9] SMTP error relaying the
message to server hotmail.com: 64.4.33.7:
30/04/2005 03:15:04 - [    9] Trying the server
hotmail.com: 64.4.32.7
30/04/2005 03:15:04 - [    9] SMTP error relaying the
message to server hotmail.com: 64.4.32.7:
30/04/2005 03:15:04 - [    9] Server error: . Will
retry in 0 hr 1 min 


I am a bit frustrated now with the mail() function.
All I want is very simple that my Apache-PHP server
(localhost with IP 127.0.0.1) will be able to send
e-mail as intended. I believe that I will need to
install a mail server. May I get some inputs, please?
Thank you

Regards,

Wong

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux