Connect. Communicate. Collaborate. Securely.

Home » Kerio User Forums » Kerio Connect » How to make a PHP mail form working on a local server
  •  
dingo

Messages: 6
Karma: 0
Send a private message to this user
Hello,

I would like to use this oppertunity to say how extremley satisfied I am with Kerio mail server. Used WebStar server suite before and then tried OSX server.

I am having one problem. On my server a customer is using a mail form to check for vacancies in a guesthouse. The scprit that is used is this:

<?php

// Simple Form Script
// Copyright (C) 2005 Eric Zhang
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// Please send bugs/questions to erkzh<.a.t.>yahoo.com.

//--------------------------Set these paramaters--------------------------


$subject = 'fyrirspurn fr· vef frost og funa'; // Subject of email sent to you.
$emailadd = 'info<.a.t.>domain.xx'; // Your email address. This is where the form information will be sent.
$url = 'http://www.domain.xx/islenska/samband/takk.html'; // Where to redirect after form is processed.
$req = '1'; // Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.

// --------------------------Do not edit below this line--------------------------
$text = "Ni?urst??ur:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key er ekki fyllt ?t (smelli? · til baka hnappin og fylli? ?t alla reiti)";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>

When the form sends post to the mailserver I get the following error:

[06/Feb/2007 22:15:36] Message from IP address 213.176.147.100, sender <www<.a.t.>localhost.localhost> rejected: sender domain does not exist

What can I do the make this work?

Best regards,
Ingolfur Bruun
  •  
adamr

Messages: 3
Karma: 0
Send a private message to this user
Hi
Check settings in your php.ini. Did you set properly values for

[mail function]
; For Win32 only.
;SMTP = localhost
SMTP = mail.yourdomain.com
smtp_port = 25

and in following lines in .ini file.

Best regards
Adam
  •  
dingo

Messages: 6
Karma: 0
Send a private message to this user
Hello Adam,

Thank you for your suggestion. It did not work. I am still trying to find a solution.

Best regards,
Ingolfur
  •  
keywerks

Messages: 73
Karma: -2
Send a private message to this user
Your hostname (localhost.localhost) isn't resolvable, so it will be rejected by KMS. Fix it and it will work. The easiest way is to edit your /etc/hostconfig and add HOSTNAME=<full-qualified-hostname> (i.e. "www.superserver.com") if it isn't included. If there is a HOSTNAME entry, edit it to match your DNS entries.

That's all.

[Updated on: Mon, 19 February 2007 10:00]


*************************************
PHPStar - the missing gear in your web engine
Visit http://phpstar.keywerks.de
*************************************
  •  
dingo

Messages: 6
Karma: 0
Send a private message to this user
Hello,

Thanks for the input. I will try this.

Best regards,
Ingolfur
Previous Topic: outlook connector and page file usage problem
Next Topic: Encrypting / Digital Signing Emails
Goto Forum:
  


Disclaimer:
Kerio discussion forums are intended for open communication between forum members and may contain information and material posted by members which may be useful in learning about Kerio products. The discussion forums are not intended to provide technical support for any specific product. Any information implied or expressed in the discussion forums is that of the posting member. Kerio is in no way responsible for the information posted in the forums, or its accuracy. Kerio employees may participate in the discussions, but their postings do not represent an offical position of the company on any issues raised or discussed. Kerio reserves the right to monitor and maintain the forums to promote free and accurate exchange of information.

Current Time: Sat Nov 18 02:13:46 CET 2017

Total time taken to generate the page: 0.00474 seconds
.:: Contact :: Home ::.
Powered by: FUDforum 3.0.4.