Thread: How to setup a mail server
hey guys, have apache running web server , have php installed. found out apache cannot send mail through mail() function in php without other software installed. wondering if can tell me how mail server , running. tried installing postfix , tested mail() function , says works now, don't know how view mail see if came through.
thank in advance,
scott
you dont have set mail server on particular machine. can use existing mail server. perhaps isp's email server. setting mail server can quite bit of work, because there lots of security things aware of. tend create mail account web application , send that.
prefer use phpmailer send email rather mail() function, both work fine.
php code:<?php
$smtpserver = 'mail.bacon.net.nz'; //set my mail server to this...
$to = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'from: webmaster@example.com' . "\r\n" .
'reply-to: webmaster@example.com' . "\r\n" .
'x-mailer: php/' . phpversion();
ini_set ( "smtp", $smtpserver );
date_default_timezone_set('america/new_york');
mail($to, $subject, $message, $headers);
?>
Forum The Ubuntu Forum Community Ubuntu Specialised Support Ubuntu Servers, Cloud and Juju Server Platforms [ubuntu] How to setup a mail server
Ubuntu
Comments
Post a Comment