Sendmail Server for WAMP5
Posted by: lowell (
Date: November 15, 2008 11:58PM

Does anyone know if the fake sendmail server at [] is safe to use? I'm new to sending email via the PHP mail function, but I have discovered it doesn't work with WAMP unless I also have a sendmail server.

Options: ReplyQuote
Re: Sendmail Server for WAMP5
Posted by: toivo (
Date: November 16, 2008 01:45AM

You do not need a sendmail server, as long as the SMTP entry in php.ini points to an email server, either your ISP's outgoing mail server which you normally use from your site or something else. If your application has different options, do not select sendmail but SMTP, and the default IP address or domain from php.ini will be used.

If you plan to allow public users to fill in forms, make sure you have done research about 'mail injection', 'SQL injection' 'PHP security'. Unless your application scrubs every input variable clean of malicious code before it passes them to the mail() function or MySQL statements, you would have to kiss your server goodbye because it would easily get 0wn3d...


nottingham, uk

Options: ReplyQuote
Re: Sendmail Server for WAMP5
Posted by: lowell (
Date: November 16, 2008 02:18AM

I'm using this strictly as a development platform on my PC right now. I will transfer it to a live web server, once i have everything working on the development platform. I do have code to scrub the form input I'll get when the site goes live.

I've tried setting php.ini but I get an error message. Here is how I have the [Mail Function] set in php.ini, with the private stuff replaced by generic terms:

[mail function]
; For Win32 only.
smtp_port = 25
auth_username=myusername - I have also tried
sendmail_from =

The error message I get is:

mail()[<a href='function.mail>function.mail</a>confused smileyMTP Server Response: 501 need user@domain at

followed by the line number in my PHP script where the error occurs.

The lines in my PHP script are:

$encoded_email = urlencode($_POST['user_name']);

$mail_body = <<< EOMAILBODY
Thank you for registering at Click this link to confirm your registration:
Once you see a confirmation message, you will be logged into

mail ($encoded_email, ' Registration Confirmation', $mail_body, 'From:');

It seems I'm reaching my ISP's SMTP server, but something is going wrong at that point.

Any ideas? Should the value to the right of the equal signs in php.ini be enclosed in quotes?


Options: ReplyQuote
Re: Sendmail Server for WAMP5
Posted by: lowell (
Date: November 16, 2008 04:54PM

I solved it. The error was due to the code

$encoded_email = urlencode($_POST['user_name']);

urlencoding places the %40 in the recipient EM address so that it reads

Email now works as expected.


Options: ReplyQuote

Sorry, only registered users may post in this forum.