Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/282.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 一些免费邮件服务器发送邮件_Php_Phpmailer - Fatal编程技术网

Php 一些免费邮件服务器发送邮件

Php 一些免费邮件服务器发送邮件,php,phpmailer,Php,Phpmailer,因为我们没有邮件服务器。是否可以免费使用任何邮件服务器使用php mailer发送电子邮件。比如说一些免费邮件服务器用于我的目的通常不会。因为这对于垃圾邮件发送者来说是显而易见的(请参阅)。不过,您也可以在ISP上使用邮件服务器。您可以这样使用Gmail: <?php require("class.phpmailer.php"); $mailer = new PHPMailer(); $mailer->IsSMTP(); $mailer->Host = 'ssl://smtp.

因为我们没有邮件服务器。是否可以免费使用任何邮件服务器使用php mailer发送电子邮件。比如说一些免费邮件服务器用于我的目的

通常不会。因为这对于垃圾邮件发送者来说是显而易见的(请参阅)。不过,您也可以在ISP上使用邮件服务器。

您可以这样使用Gmail:

<?php
require("class.phpmailer.php");
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->Host = 'ssl://smtp.gmail.com:465';
$mailer->SMTPAuth = TRUE;
$mailer->Username = 'fake[ @ ] googlemail.com';  // Change this to your gmail adress
$mailer->Password = 'fakepassword';  // Change this to your gmail password
$mailer->From = 'fake[ @ ] googlemail.com';  // This HAVE TO be your gmail adress
$mailer->FromName = 'fake'; // This is the from name in the email, you can put anything you like here
$mailer->Body = 'This is the main body of the email';
$mailer->Subject = 'This is the subject of the email';
$mailer->AddAddress('fake2[ @ ] gmail.com');  // This is where you put the email adress of the person you want to mail
if(!$mailer->Send())
{
   echo "Message was not sent<br/ >";
   echo "Mailer Error: " . $mailer->ErrorInfo;
}
else
{
   echo "Message has been sent";
}
?>

我正在家用电脑上使用hMailServer测试邮件相关组件。但是,它要求您已经有一个邮件服务器。所以我把我的GMail帐户设置到hMailServer并使用它。它已经完美地工作了2年


关于GMail的唯一一点是,所有发送的电子邮件都在你的GMail地址中。

有各种免费系统可用(例如,)。这些都有发送限制(我听说谷歌的每个发送账户有500个唯一的收件人),当然,如果提供免费服务,你很容易受到提供服务的组织的突发奇想的影响。免费服务有一种倾向,即以一种非常不干涉和规避风险的方式运行(当然!),所以任何不寻常的事情都会让你在几乎没有(如果有的话)追索的情况下关闭


免费的下一步是廉价的。就我而言,便宜的服务给我带来了很好的效果。我通过RunBox发送,通过谷歌应用程序接收(因为谷歌优秀的垃圾邮件过滤功能),而且成本很低。如果我给他们发邮件有问题,他们会回复。这并不是对他们的特别认可(除了作为客户之外,我与他们没有任何关系),只是一个注意事项,有时候只付一点点钱就可以买到很多东西。

如果这涉及到你的客户,你真的需要在这里提一提,因为这对可用的选项有很大的影响。如果没有,道歉。不管怎样,你越清楚自己的要求,你得到的答案就越好,人们就越不会浪费时间给你那些不适合你的答案?这应该在没有任何SMPT服务器的情况下正常工作?要在WAMP上进行的任何配置?
$mailer->Host
必须是
$mailer->HostName
(在我的托管服务器上工作,但在本地服务器上仍然不工作,我不知道要在WAMP服务器上进行的配置)