Jump to content

[SOLVED] mail() using wamp?


Dragen

Recommended Posts

Hi,

I've been using wamp to test my site and have bumped into a problem.

Does anyone know if wamp can handle the mail() function or if I need to set it up?

 

I'm trying to test a contact form, but the file that actually sends the data is identical to one I'm using on my site with no glitches. Every time I try it on wamp I get an error saying the message couldn't be sent.

I'm using this code to send it:

      if (mail($recipient, $subject, $message, $headers)){
         echo '<p align="center">Thank you<br />Your message has been successfully sent</p>We will get back to you as soon as possible.';
      } else
         echo '<p align="center">An error occurred and the message could not be sent.<br /><a href="javascript:history.go(-1);">please try again</a></p>';

and it always outputs

An error occurred and the message could not be sent.

 

I tried echoing $recipient, $subject, $message and $headers to check that they were being sent and they were, so I presume the mail() function doesn't work on wamp..

Link to comment
https://forums.phpfreaks.com/topic/55829-solved-mail-using-wamp/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.