$param["host"]="22.152.33.113"; - //The server to connect. $param["port"]=25; - //The port to connect. Default is 25 $param["auth"]= 1; - //Whether or not to use SMTP authentication. Default is FALSE $param["username"]="[email protected]"; //- The username to use for SMTP authentication. $param["password"]="123456"; //- The password to use for SMTP authentication // Create the mail object using the Mail::factory method $mail_object =& Mail::factory('smtp', $param); if($mail_object->send($recipients, $headers, $body)) {
return true; } else return false; }//like this try it //Mail.php download url: http://pear.php.net/package/Mail ?>
不加可以发出,但是电子邮件地址是服务器的地址,我不能指定了,请问有没有其它的解决方法可以解决这个问题。谢谢。200分相送。
找个email的类发发试试.
///推荐使用PEAR/MAIL类
require_once('Mail.php');
function sendPaswd($email,$msg)
{
$recipients = trim($email);
//$headers['To'] = $email;
$headers['From'] = '[email protected]';
$headers['Subject'] = 'Subject';
$body = "--------------------Subject------------------------<br>";
$body .= " ".$msg." ";
$param["host"]="22.152.33.113"; - //The server to connect.
$param["port"]=25; - //The port to connect. Default is 25
$param["auth"]= 1; - //Whether or not to use SMTP authentication. Default is FALSE
$param["username"]="[email protected]"; //- The username to use for SMTP authentication.
$param["password"]="123456"; //- The password to use for SMTP authentication
// Create the mail object using the Mail::factory method
$mail_object =& Mail::factory('smtp', $param);
if($mail_object->send($recipients, $headers, $body))
{
return true;
}
else return false;
}//like this try it
//Mail.php download url: http://pear.php.net/package/Mail
?>
在安装vpopmail时加上参数:
./configure --enable-default-domain=ghry.com
如果要设置,做哪些工作?
如果它装了MailServer应该就可以用了。