PHPMailer SMTP connect()在CONTABO VPS上失败但在本地工作

时间:2014-09-02 15:38:01

标签: php apache phpmailer vps

此代码在本地工作得很好。但是当我把它放在我的VPS上时它不起作用。有人可以解释一下为什么吗?

$mail = new PHPMailer;
$mail->CharSet = 'UTF-8';

//Encoding da base de dados
$mail->Encoding = "base64";

$mail->IsSMTP();
$mail->SMTPDebug = 0;
$mail->SMTPAuth = 'login';
$mail->SMTPSecure = 'ssl';
$mail->Host = 'something.domain.com';
$mail->Port = 465;
$mail->Username = 'myusername@domain.com';
$mail->Password = '*mypass*';

$mail->SetFrom('somename@domain.com', 'Myname');
$mail->Subject = 'Email de teste';
$mail->Body = 'The content';
$mail->AddAddress('destination@server.com');
$mail->Send();

0 个答案:

没有答案