Hello,

I want to embed a mail server on my computer. For that purpose I've installed MDaemon v9.5.3 on my computer. Now what else do I have to do in order to send/recieve mail from different people? Should I have to change configuration settings in "PHP.ini" and/or "httpd.conf"?

I always get an error like this whenever I use mail() function :
Warning: mail() [function.mail]: SMTP server response: 550 <>, Recipient unknown in C:\Prog\SERVER\DocumentRoot\SendMail\Send.php on line 69
The code on line 69 is mail() function of PHP.

My system :
WinXP
Apache 2.0
PHP 5
MDaemon 9.5

Dani AI

Generated

Quick diagnostic summary for : the PHP warning "SMTP server response: 550 ..., Recipient unknown" means the SMTP server (MDaemon) is the one rejecting the RCPT TO — PHP on Windows hands mail off to the SMTP host configured in php.ini, so the 550 is coming from MDaemon rather than from PHP itself. MDaemon will reject delivery if it thinks the domain is local but the mailbox (or alias) doesn't exist. (php.net)

Short checklist of focused tests (do these first):

  • Verify PHP is pointed at the local SMTP server and that php.ini changes were saved (restart the webserver so PHP picks them up).
  • Confirm MDaemon is running and listening on TCP/25, and inspect its logs for the exact RCPT/SMTP conversation.
  • Quick local checks:
netstat -an | find ":25"
telnet localhost 25

The php.ini mail options and how PHP uses an SMTP host on Windows are documented by PHP; use the logs and the checks above to see whether MDaemon or a downstream server issued the 550. (php.net)

How to fix it (choose the option that matches intent):

  • If you host that domain on this machine: add the mailbox/alias in MDaemon (or set a postmaster alias) so local delivery succeeds, or configure MDaemon’s "Unknown Mail" behaviour to forward unknown addresses to a smart host.
  • If you do NOT host the recipient domain: remove the domain from MDaemon’s local domains so MDaemon will perform normal MX lookups instead of treating it as local.
  • If sending outbound to the Internet, consider authenticating through an external SMTP relay (use an SMTP library such as PHPMailer rather than raw mail()) — also be aware many residential ISPs block outbound port 25, so relaying via the ISP or using submission ports (587/465) may be necessary. (help.mdaemon.com)

Actionable summary: restart Apache after php.ini edits, confirm SMTP is reachable from localhost, read the MDaemon delivery logs to see which host returned the 550, then either create the missing mailbox/alias or change MDaemon’s domain/unknown-mail routing. ’s suggestion to use an SMTP-capable library is a practical workaround when local SMTP configuration is not desired or when the ISP blocks direct MX delivery.

Recommended Answers

All 3 Replies

Member Avatar for Member #117553

If you are using WinXP pro, you should think of installing IIS with SMTP services on. IIS is MS native web server, including HTTP, FTP and SMTP server. Still you can install only the SMTP server.

Then, set your php.ini to send mail via the localhost. If any additional setup is needed to be performed consult the php manual.

Then your mail function should work normally.

This is about sending e-mails. In order to receive mails, though, you should have your computer's IP registered as a domain in order other people's mail servers to find it.

If you have e real internet IP people may be able to send you mails like this:
e.g. your ip is
people could mail you to

commented: Thank you. +1
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
sendmail_from = me@example.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

This is a block from PHP.ini file.
Are the settings which I must change any of these?

And...
I'm using WinXP Home Edition.
This is the relevant Apache settings in httpd.conf file :

ServerName www.localhost.com:80
Member Avatar for Member #117553
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
sendmail_from = me@example.com

; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path =

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

This is a block from PHP.ini file.
Are the settings which I must change any of these?

And...
I'm using WinXP Home Edition.
This is the relevant Apache settings in httpd.conf file :

ServerName www.localhost.com:80

Yes, these are the settings, however IIS is not available on home edition. You may look over the internet if you can download and install a stand-alone IIS server on WinXP Home. Meantime, here is a simple phpclass that substitutes the php mail functions. All it needs is a valid smtp server that you normally can login and send mail from.

http://phpmailer.sourceforge.net/

You can use your own e-mail if you want for testing purposes.
A simple tutorial is available on the page I have sent to you.

Basicly, you have to require the script from your mailing form, and it will do the rest for you. You can set it on any server as part of your website. It does not need installation - it is as simple as creating your own mailing script.

Regarding your mail server, or whatever the program you have installed. If you cannot send mail, maybe you have not configured a DNS server. You can use your internet providers DNS servers to resolve e-mail hosts in order to send mail from your program.

Check the program's manual for instructions how to set the DNS server addresses for sending mail.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.