send mail in php
in this example, we will show how to send an email message to someone in php.
php code:
<?php
echo "<html><body>";
mail ("karn@nucleus.com", "subject", "hello!");
echo "sending mail...";
echo "</body></html>";
?>
it is that simple!
the php mail function has up to four parameters. the first parameter is the recipient of the message. the second parameter is the subject of the email message. the third parameter is the body of the message. and the fourth parameter is optional, which will be covered on the next page.
if the above example does not work when you view it in your browser then the sendmail variable in your php setup file is probably not set correctly. in unix, it should be set to something like '/usr/sbin/sendmail -t'. consult your php documentation for more in depth instructions.
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器