当我在ubuntu上搜索配置sendmail时,我没有得到任何明确的答案,每个人都认为我知道他们在说什么,
我只想要基本配置来启用电子邮件发送,基本上我将使用它与谷歌应用程序引擎启用从开发服务器发送邮件.
我已经这样做了:
sudo apt-get install sendmail
Run Code Online (Sandbox Code Playgroud)
然后
sudo sendmailconfig
Run Code Online (Sandbox Code Playgroud)
但我不知道最后一个人到底做了什么.
我已经使用phpmailer()概念使用php脚本从我的共享服务器向用户发送邮件,但是根据phpmailer代码,即使我的脚本中的所有内容都正确,我也无法发送.
我的代码是这样的:
$message = " This is testing message from my server";
$mail = new PHPMailer(); // create a new object
$mail->IsSMTP(); // enable SMTP
$mail->Host = "smtp.gmail.com";
$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
$mail->Port = 465; // or 587
$mail->IsHTML(true);
$mail->Username = "moorthi.mrk10@gmail.com"; // My gmail username
$mail->Password = "************"; // My Gmail Password
$mail->SetFrom("moorthi.mrk10@gmail.com"); …
Run Code Online (Sandbox Code Playgroud)