1
早上好, 我想删除gmail警告'gmail couln't验证... @ ...发送此消息'当我用php发送邮件。删除发送邮件时未验证的gmail警告邮件用PHP发送邮件
我知道这是因为我使用的电子邮件功能php没有认证,所以我尝试PHPMailer和PHP梨,但页面转向,直到无限且没有任何事情发生。 我的主机是1 & 1. 我尝试用gmail代替smtp和帐户而不是1 & 1但结果相同。
<?php
// Pear Mail Library
require_once "Mail.php";
$from = '<***@motelavigna.co>'; //change this to your email address
$to = '<***@gmail.com>'; // change to address
$subject = 'Insert subject here'; // subject of mail
$body = "Hello world! this is the content of the email"; //content of mail
$headers = array(
'From' => $from,
'To' => $to,
'Subject' => $subject
);
$smtp = Mail::factory('smtp', array(
'host' => 'auth.smtp.1and1.fr',
'port' => '465',
'auth' => true,
'username' => '***@***.co', //co is not an error
'password' => '***' // your password
));
// Send the mail
$mail = $smtp->send($to, $headers, $body);
?>
谢谢。
感谢它的工作,用简单的鄂麦,但不与PEAR邮件,但它足以让我。 – bormat