Connect. Communicate. Collaborate. Securely.

Home » Kerio User Forums » Kerio Connect » PHP mail() associate with Kerio connect 7.1.x
  •  
briansky

Messages: 35
Karma: 0
Send a private message to this user
Hi,

I am writing php web page on Mac OS X server (server 1), Kerio connect also running on server 1, I would like to use PHP mail() functon on the webpage, how can I associate to Kerio connect so that I can send email to Kerio email account?

e.g. users fill out the web form, after submit, the message via PHP email() function to Kerio connect email account.

I know that PHP mail() is simple, just run:

mail('test<_at_>example.com', 'My Subject', $message)

but it seems work for outside, not work on internal Kerio Connect.

Any help, thanks.

Briansky
  •  
tonyswu

Messages: 271
Karma: 5
Send a private message to this user
I would recommend you to take a look at PEAR.
  •  
briansky

Messages: 35
Karma: 0
Send a private message to this user
thanks.

PHPmailer has simple structure, but I am afraid PEAR is more complicated.

Below is phpmailer testing code:

<?php
// PHPMailer
require("../phpMailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "smtp.server.com"; // SMTP servers
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "username"; // SMTP username
$mail->Password = "123456"; // SMTP password

$mail->From = "myemail@localhost";
$mail->FromName = "My Name";

// $mail->AddAddress()
$mail->AddAddress("to<_at_>email.com","abc");
$mail->AddAddress("to2<_at_>email.com"); // optional name

$mail->AddReplyTo("jyu<_at_>aemtechnology.com","ABC");


// $mail->AddAttachment()
$mail->AddAttachment("path_to/file"); // attachment
$mail->AddAttachment("path_to_file2", "INF");

//
$mail->IsHTML(true); // send as HTML
$mail->Subject = "testing email";
$mail->Body = "This is the <b>HTML body</b>";
$mail->AltBody = "This is the text-only body";

if(!$mail->Send())
{
echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}

echo "Message has been sent";
?>

  •  
hpralow

Messages: 15
Karma: 0
Send a private message to this user
You should be able to user PHP's mail() function with Kerio Mail Server.
All you need to do is to tell PHP, which sendmail tool to use.
Open your /etc/php.ini with a text editor (not Word) and edit the line
reading
;sendmail_path =
to be
sendmail_path = /usr/local/kerio/sendmail

Restart the Web-Service and
PHP mail will then use Kerio Mail Server to deliver mails.
Note the Apple's Mail service must NOT be active on the server
Previous Topic: Kerio Connector for BlackBerry will be discontinued.....
Next Topic: iCal does not show any Calendar items
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: Sun Aug 20 04:10:23 CEST 2017

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