-3
codeigniterを使用してGmailの受信トレイにスパムではないメールを送信したいと思います。私は次のコードを書いていますが、メールは受信トレイではなくスパムに送られました。codeigniterを使用してGmailの受信トレイに電子メールを直接送信する方法
マイコード:
<?php
$this->load->library('email');
//SMTP & mail configuration
$email = $this->input->post('email');
$config = array(
'protocol' => 'tls',
// 'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => '*****',
'mailtype' => 'html',
'charset' => 'utf-8',
'mailpath' => '/usr/sbin/sendmail',
'wordwrap' => TRUE,
);
$this->email->initialize($config);
$this->email->set_mailtype("html");
$this->email->set_newline("\r\n");
//Email content
$data = 'http://52.14.24.245/upload/images/purchasedticket/'.$qrcode_image;
$htmlContent .= '<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title> </title>
<link rel="stylesheet" href="">
</head>
<body>
<p>Hi ,</p><br>
<strong>Payment for party ticket is successfull! </strong>
<p>Following is the QR Code, kindly present this QR code while you attend the party. </p>
<br>
URL : '.$data.'
<br>
<img src="'.$data.'"/><br />
<br>
Thanksbr, <br><br>
TheMove Team
</body>
</html>';
// $htmlContent = 'TheMove: party ticket purchase success!!';
// $htmlContent .= '<p>This email has sent via SMTP server from CodeIgniter application.</p>';
$this->email->to($email);
$this->email->from('[email protected]','Party App');
$this->email->subject('TheMove: party ticket purchase success!!');
$this->email->message($htmlContent);
//Send email
$data = $this->email->send();
?>
どのように私は電子メールがスパムではないGmailの受信トレイに直接送信することができますか?
Gmailはメッセージが迷惑メールフォルダに入れられる理由を説明します。 –
あなたはここにあなたの資格情報を掲示していますか? –
* sigh *投稿からパスワードを削除しました。 **すぐにパスワードを変更してください**。 –