小编som*_*ser的帖子

PHPmailer不使用SMTP

我已将PHPMailer文件夹添加到我的Web服务器上的根文件夹中,我只是收到与SMTP有关的错误.

有没有办法使用PHPMailer而无需登录邮件帐户?我可以让服务器将电子邮件发送到一个地址吗?

我正在搜索这个网站并找到了这个

$email = new PHPMailer();
$email->From      = 'you@example.com';
$email->FromName  = 'Your Name';
$email->Subject   = 'Message Subject';
$email->Body      = $bodytext;
$email->AddAddress( 'destinationaddress@example.com' );

$file_to_attach = 'PATH_OF_YOUR_FILE_HERE';

$email->AddAttachment( $file_to_attach , 'NameOfFile.pdf' );

return $email->Send();
Run Code Online (Sandbox Code Playgroud)

但我得到一个错误说 "Message could not be sent.Mailer Error: You must provide at least one recipient email address."

php phpmailer

8
推荐指数
2
解决办法
2万
查看次数

标签 统计

php ×1

phpmailer ×1