标签: swiftmailer

跟踪电子邮件退回,打开和点击

我发现如何确保以编程方式发送的电子邮件不会自动标记为垃圾邮件?(希望)是避免被标记为垃圾邮件的坚实指南.还有其他重要提示/建议吗?

如何跟踪退回,打开和点击? 这些功能可在Mail ChimpCampaign Monitor等付费服务中找到.

email smtp email-spam swiftmailer

16
推荐指数
4
解决办法
2万
查看次数

如何关闭SwiftMailer中的Smtp连接

我使用SwiftMailer从一个齿轮工人进程发送电子邮件.我正在使用该Swift_SmtpTransport课程发送电子邮件.

问题是如果此工作进程暂时保持空闲状态,则SwiftMailer smtp连接会超时.现在,当下一个作业到来时,SwiftMailer无法发送电子邮件,因为连接已超时.

理想情况下,我想在每个工作后关闭smtp连接.我无法在课堂上找到一个专门做这个的api.unset()对象也不起作用,因为这是一个静态类.

php email smtp worker swiftmailer

16
推荐指数
3
解决办法
1万
查看次数

绕过Gmail的垃圾邮件过滤器(使用PHP从共享主机发送的邮件)

TL; DR:从共享主机发送的邮件(例如Unoeuro或One.com的廉价域名)最终会被垃圾邮件发送.怎么修?


我制作了一个邮件系统,它首先生成一个PDF文件(使用FPDF),然后将PDF文件作为附件发送给PHP的Swiftmailer.这封电子邮件已发送给130人(作为"一张发票").但是几乎每个人都陷入垃圾邮件过滤器.我尝试调整SwiftMailers标头设置,但没有任何运气.即使是我以前没有寄过的邮件(经过全面测试).这是我最初的设置:

function sendMailEt($toEmail, $toName, $invoiceNumber){

require_once('includes/lib/swift_required.php');

$transport = Swift_SmtpTransport::newInstance('mailout.one.com', 25)
  ->setUsername('EMAIL-ACCOUNT1@THE-DOMAIN.DK')
  ->setPassword('THE-PASSWORD')
  ;    

$mailer = Swift_Mailer::newInstance($transport);

$message = Swift_Message::newInstance('FROM COMPANY')
      ->setSubject('Thanks for signing up - COMPANY')
  ->setFrom(array('EMAIL-ACCOUNT1@THE-DOMAIN.DK' => 'Company name'))
  ->setTo(array($toEmail => $toName))
      ->setBody('A brief body, that explains that this is an invoice and that it has to be paid within 5 days. (written in danish)')
      ->addPart('A brief body, that explains that this is an invoice and that it has to be paid within 5 …
Run Code Online (Sandbox Code Playgroud)

php email spam-prevention spam swiftmailer

16
推荐指数
2
解决办法
1万
查看次数

在symfony2中记录swiftmailer send()活动

我使用swiftmailer从我的symfony2.2项目发送邮件.有没有办法记录全球所有电子邮件信息并发送结果?

如果邮件程序send()方法有触发somę事件会很好,但我看不到它.

php logging swiftmailer symfony symfony-2.2

15
推荐指数
3
解决办法
1万
查看次数

邮件上的swift邮件错误'Swift_RfcComplianceException'实际上有效吗?

我的快速邮件插件刚刚抛出错误,因为它试图发送到的电子邮件地址不符合要求.问题是 - 电子邮件是有效的.

基本上,我不希望swift邮件程序检查电子邮件是否有效我不管它是否发送.那可能吗?

这里的代码有显示错误的功能,但我不知道我需要改变的是否在这里(有点黑客程序员:|)

//@require 'Swift/Mime/Headers/AbstractHeader.php';
//@require 'Swift/Mime/HeaderEncoder.php';

/**
 * A Mailbox Address MIME Header for something like From or Sender.
 * @package Swift
 * @subpackage Mime
 * @author Chris Corbyn
 */
class Swift_Mime_Headers_MailboxHeader extends Swift_Mime_Headers_AbstractHeader
{

  /**
   * The mailboxes used in this Header.
   * @var string[]
   * @access private
   */
  private $_mailboxes = array();

  /**
   * Creates a new MailboxHeader with $name.
   * @param string $name of Header
   * @param Swift_Mime_HeaderEncoder $encoder
   */
  public function __construct($name, Swift_Mime_HeaderEncoder …
Run Code Online (Sandbox Code Playgroud)

php email swiftmailer

14
推荐指数
2
解决办法
2万
查看次数

swiftmailer和电子邮件形式与附件 - 初学者

像往常一样,这里是我学到很多东西的地方.我现在有了新的东西需要学习:

我有一个HTML格式:

<tr><td width="16%">File attachment</td><td width="2%">:</td><td><input type="file" name="fileatt" /></td></tr>
Run Code Online (Sandbox Code Playgroud)

和mail.php:

$attachfile=$_POST["fileatt"];
Run Code Online (Sandbox Code Playgroud)

和一个正确的swiftmailer代码发送电子邮件;

我已经google了,我发现了许多例子如何发送附件与存储在网站上的文件,但我想在飞行中这样做.因此,当您提交按钮时,它会将其发送给人们而不是上传文件.

// Create the Transport
$transport = Swift_SmtpTransport::newInstance('mail.server.co.uk', 25)
->setUsername('user')
->setPassword('pass')
;

// Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);

// Create a message
$message = Swift_Message::newInstance($subject)
  ->setFrom(array('emai@emai.com' => 'name'))

   ->setBody($html, 'text/html')
  ;
// Add alternative parts with addPart()
$message->addPart(strip_tags($html), 'text/plain');

// Send the message
$result = $mailer->send($message);
Run Code Online (Sandbox Code Playgroud)

有人可以帮我如何进行即时文件上传吗?提前致谢!!!

php swiftmailer

14
推荐指数
2
解决办法
3万
查看次数

是否有正确的方法在symfony中使用SwiftMailer包将NTLM auth类型添加到SwiftMailer中?

我有swiftMailer包的symfony项目.我试图使用NTLM auth通过swiftmailer发送电子邮件.但我还没有找到通过配置捆绑打开NTLM的方法.

经过努力,我找到了解决方案

第一解决方案

current($this->get('mailer')->getTransport()->getExtensionHandlers())
    ->setAuthenticators([new \Swift_Transport_Esmtp_Auth_NTLMAuthenticator()]);
Run Code Online (Sandbox Code Playgroud)

在config.yml中注释spool

#    spool:     { type: memory }
Run Code Online (Sandbox Code Playgroud)

但它看起来有点奇怪.

二解决方案

删除SwiftMailer包并直接使用swiftMailer,因为默认情况下会激活ntlm auth类型.

有没有更好的方法来使用NTLM auth类型?

php ntlm swiftmailer symfony

14
推荐指数
1
解决办法
910
查看次数

使用Swift发送HTML电子邮件

我想使用Swift从我的应用程序发送带有HTML正文的自动生成的电子邮件.

这是我目前的代码:

$message = Swift_Message::newInstance()
                ->setFrom(array('dummy1@test.com' => 'John Doe'))
                ->setTo('dymmy2@test.com')
                ->setSubject('some subject');

            $message->setBody($this->getPartial('global/mail_partial'));

            $this->getMailer()->send($message);
Run Code Online (Sandbox Code Playgroud)

我已经尝试使用某些特定的Swift方法更改电子邮件消息的标题内容类型,但它无法正常工作.

email symfony1 swiftmailer

13
推荐指数
1
解决办法
2万
查看次数

Laravel 4邮件类,如何知道邮件是否已发送?

我正在使用Laravel 4中的新邮件类,有人知道如何检查电子邮件是否已发送?至少邮件已成功移交给MTA ......

swiftmailer laravel laravel-4

13
推荐指数
1
解决办法
9759
查看次数

PHP - 使用STARTTLS和自签名证书的Swiftmailer

我正在尝试使用STARTTLS发送带有php和swiftmailer的电子邮件,但我收到了证书错误.我具有SMTP服务器的root访问权限,并且使用的证书是自签名的.我在两台机器上使用Debian(Web服务器和smtp服务器)

PHP message: PHP Warning: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in [..]/lib/classes/Swift/Transport/StreamBuffer.php on line 97 PHP message: PHP Fatal error: Uncaught exception 'Swift_TransportException' with message 'Unable to connect with TLS encryption' in [..]/lib/classes/Swift/Transport/EsmtpTransport.php:294

我是否需要在某个地方添加自己的证书才能接受它?或者这是一些OpenSSL配置错误?

php smtp certificate self-signed swiftmailer

12
推荐指数
3
解决办法
2万
查看次数