私は電子商取引システムを開発中です。私のeコマースシステムは私のホスティングの中でズームと呼ばれています。私は注文の部分でやっているし、今、私は電子メールを送信するのが難しいです。Codeigniterを使用して受信トレイの代わりに迷惑メールフォルダに電子メールを送信
これは動作していますが、受信トレイではなく迷惑メールフォルダに入ります。
注:私はすでに私のホスティングズームで電子メールアカウントを作成し、私は私のコードでそれを使用します(以下を参照することができます)
質問:私はスパムとしてラベル付けされずに電子メールを送信します。私のコードに何かがないか間違っていますか?私を正しい方向に向けてください。
コントローラ
public function process()
{
$id = $this->session->userdata('id');
$where = array('id' => $id);
$get_orders = $this->Crud_model->join_orders_customer('*','orders',$id);
$get_invoice = $this->Crud_model->get_invoice('*','orders',$id);
$email = $this->Crud_model->get_email($id);
$config = array(
'smtp_timeout' => '4',
'charset' => 'utf-8',
'mailtype'=> 'html'
);
$this->load->initialize($config);
$fromemail="[email protected]";
$to = $email->email_address;
$subject = "Your Order is not Processing";
foreach($get_orders as $row){
$mesg = "<h1>Schedule Accepted!!!</h1>
<h3>Thank you for trusting and using Exclure Pest Control. $row->product_name</h3>
<h3>Your reserve inspection is accepted. We sure to call you as soon as possible</h3>
<p>--------------------------------------------------------------------------------------</p>
<h4>For more details contact us at,</h4>
<h4>Exclure Pest Control</h4>
<h4>Email : [email protected]</h4>
<h4>Contact Number: 525-5399/ 498-1626 </h4>
<h4>Facebook : https://web.facebook.com/ExclurePestControl/</h4>";
}
$this->load->library('email');
$this->email->clear();
$this->email->from($fromemail, 'Zees Delivery');
$this->email->to($to);
$this->email->set_header('Header1', 'Value1');
$this->email->set_newline("\n");
$this->email->subject($subject);
$this->email->message($mesg);
$this->email->set_mailtype('html');
$this->email->send();
$this->cart->destroy();
echo json_encode("success");
}
電子メールが迷惑メールフォルダに保存される理由を構文エラーで説明していません。これは、電子メールよりもコードと関係があります。 SPF、DKIMなどを見てください。 –
これは主に 'server'が' code'ではないためです。このためにいくつかの電子メールプロバイダサービスを使用してみてください。 – mega6382
電子商取引システムの場合、次のような外部サービスを使用することができます。https://postmarkapp.com広告なし、私はそれを使い、好きです。代わりがあります。 –