Jump to content

Recommended Posts

Greetings all,

 

I am using WAMP as the server to run the php scripts on but this does not seem to work when sending emails. I have read various information about it but don't seem to be getting a clear answer. It seems that WAMP does not come with a mail server. I have downloaded something called KERIO Mail server hoping that this would resolve the problem. This is only a 30 day trial which is not very good. I also can't get this configured and am getting the following error.

 

Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\CIS School\sendmail.php on line 8

 

Message delivery failed...

 

<?php
        //$to = "dsdsd@gmail.com";
        //$subject = "Hi!";
        //$body = "Hi,\n\nHow are you?";
       
        $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: sender@sender.com' . "\r\n";
       
        if (mail("dsadad@bournemouth.ac.uk","test subject","test body",$headers))
        {
                echo("<p>Message successfully sent!</p>");
        }
        else
        {
                echo("<p>Message delivery failed...</p>");
        }
?>

 

Any help will be very much appreciated...

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.