发送电子邮件与在垃圾邮件中接收的codeigniter [英] sending emails with codeigniter received in junk mail

查看:168
本文介绍了发送电子邮件与在垃圾邮件中接收的codeigniter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用codeigniter电子邮件库发送电子邮件,以使用以下设置向用户发送电子邮件

am trying to send emails using codeigniter email library to send emails to users using the following settings

  $this->load->library('email');
        $this->email->from('email@domain.com','Admin');
        $this->email->to($recieverEmail);
        $this->email->subject('Morgan MarketBook');
        $this->email->message($message);


   <?php if (!defined('BASEPATH')) exit('No direct script access allowed');

   $config['protocol']   = 'smtp';
   $config['smtp_host']  = 'mail.server';
   $config['smtp_port']  = 26 ;
   $config['smtp_user']  = 'user' ;
   $config['smtp_pass']  = 'password' ;
   $config['newline']    = "\r\n";

   ?>

我的问题,收到的电子邮件是在垃圾邮件,而不是在收件箱...什么是导致这个问题?

my problem that the received emails are in the junk mail and not in the inbox...what is causing this problem ?

推荐答案

邮件进入垃圾代替收件箱不是与代码相关或与代码相关。您必须遵循一些指导原则,以免电子邮件不被视为垃圾邮件:
其中一些准则是:

Mail getting into junk instead of inbox isn't code related or codeigniter related for that matter. You have to follow some guidelines in order for the email not to be considered spam: Some of these guidelines are:


  • 发送html电子邮件,在发送html电子邮件时还包含邮件的文本版本

  • ,将HTML和图片保持最小(不包括javascript)

  • 使用spf和域密钥设置邮件服务器

  • from字段应包含有效的电子邮件地址(与邮件服务器具有相同的域)

  • 如果您发送大量电子邮件,请尝试限制发送的速度

  • when sending html email, include also the text version of the mail
  • when sending html email, keep the html and images to a minimum (don't include javascript)
  • setup the mail server with spf and domain keys
  • the "from" field should contain a valid email address (with the same domain as the mail server)
  • if you send mass emails, try to limit the rate of sending

电子邮件与php,只是google发送电子邮件的最佳做法php

there are lots of guidelines for sending valid emails with php, just google "best practice for sending emails php"

此外,不要包括您的邮件服务器的登录凭据。
Cheers

Also, don't include your login credentials to your mail server. Cheers

这篇关于发送电子邮件与在垃圾邮件中接收的codeigniter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆