Jump to content

Recommended Posts

Hi,

I'm trying to send email from a php script.  I'm using the xampp package and am trying to setup the mercury mail server to send emails but cannot find any tutorials or guides on how to.  I was wondering if anyone out there has any experience with this?

 

Here is my script

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Email</title>
</head>

<body>

<?php

$to = "root@localhost.com";
$subject = "Hi!";
$body="test";
$body.="Hello World";
$body.="Regards";
$body.="Myself";

$headers = "From: root@localhost.com"; 

if (mail($to, $subject, $body, $headers)) {
  echo("Message sent");
} else {
  echo("Message was not delivered ");
}
?> 
</body>

</html>

 

and the php.ini stuff...

[mail function]
; For Win32 only.
; http://php.net/smtp
  SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
; sendmail_from = postmaster@localhost
  send_mail_from = root@localhost

 

In Mercury I simply add new user under configurations->manage local users. As a test username is 'root' and password is 'password'

 

when I try and run the script I get this message..

 

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:\XXXXX\mailTest.php on line 22

Message was not delivered

 

 

...I am then trying to also setup an account in Thunderbird or Windows live mail but it keeps timing out...

 

anyone know how to set this up? cheers

 

 

Link to comment
https://forums.phpfreaks.com/topic/193561-mercury-mail-setup/
Share on other sites

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.