标签: swiftmailer

邮件通过电子邮件发送给50,000-100,000个订阅者

我想开发一个邮件列表应用程序,它需要能够处理一次向50,000-100,000个订阅者发送消息.

Swiftmailer的批处理发送方法可以处理吗?在电子邮件/ SMTP /邮件服务器方面,我是一个简单的东西 - 在开发这个应用程序时我需要记住哪些其他事项?

email performance smtp swiftmailer

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

php:swiftmailer的问题

我刚刚为php安装了swiftmailer,我有一些问题:

  1. 有德国变音符号的问题 - 我得到错误的字符我如何正确编码邮件正文?
  2. swiftmailer中是否有一个属性用于获取服务器日志(发送邮件进行调试时的对话框)
  3. 如果邮件是纯文本或HTML,我该如何设置属性?

谢谢

php swiftmailer

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

Swift Mailer不会返回smtp邮件失败

我正在使用Swiftmailer发送带有SMTP的电子邮件

我需要从SMTP获得响应,但我正在尝试的是不起作用.它甚至可能吗?

我尝试了一封无效的电子邮件:dima44324d@vdaszdsd1dw.com - 在下面的代码中,它不会返回错误

    if (!$mailer->send($message, $fails))
    {
          echo "Failures:";
          print_r($fails);
          return false;
    }

    return true;
Run Code Online (Sandbox Code Playgroud)

PS我不想使用PhpMailer,因为我还有其他问题.

php smtp swiftmailer

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

无法使用RabbitMQ和Symfony2发送Swift_Message

我正在使用RabbitMQBundle将RabbitMQ集成到我的symfony2项目中.一切正常(我可以制作和使用消息).但是,每当我尝试使用来自消费者的Swift_Message发送电子邮件时,我都不会收到该电子邮件.mail('foo@bar.com', 'subject', 'message');从消费者那里使用确实有效.

这是我用来发送Swift_Message的代码:

 $message = \Swift_Message::newInstance()
    ->setSubject($subject)
    ->setFrom('noreply@bar.com')
    ->setTo('foo@bar.com')
    ->setBody('Foo Bar');

  $this->container->get('mailer')->send($message);
Run Code Online (Sandbox Code Playgroud)

此代码在"普通"控制器或服务中工作.但是,当RabbitMQ在消费者中触发时,它不起作用.

有任何线索吗?

php swiftmailer rabbitmq symfony

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

Swift Mailer:多收件人选项不起作用

虽然有许多相同的问题,但没有一个解决方案适合我.仅当只有一个收件人时才会发送邮件,否则会生成错误.此外,我只发送内部电子邮件,没有外部.

任何的想法?

码:

$to = 'one@example.com, two@example.com, three@example.com';

$transport  = Swift_SmtpTransport::newInstance('192.168.whatever', 25);
$mailer     = Swift_Mailer::newInstance($transport);
$message    = Swift_Message::newInstance('Test')
                ->setFrom(array('myself@example.com'))
                ->setTo(array($to))
                ->setBody('html content goes here', 'text/html');

$result = $mailer->send($message);

echo $result;
Run Code Online (Sandbox Code Playgroud)

错误:

Fatal error: Uncaught exception 'Swift_RfcComplianceException' with message 'Address in mailbox given [one@example.com, two@example.com, three@example.com] does not comply with RFC 2822, 3.6.2.' in C:\wamp\www\ssl\swift_emailer\lib\classes\Swift\Mime\Headers\MailboxHeader.php:308 Stack trace: #0 C:\wamp\www\ssl\swift_emailer\lib\classes\Swift\Mime\Headers\MailboxHeader.php(238): Swift_Mime_Headers_MailboxHeader->_assertValidAddress('lukas.borecki@l...') #1 C:\wamp\www\ssl\swift_emailer\lib\classes\Swift\Mime\Headers\MailboxHeader.php(96): Swift_Mime_Headers_MailboxHeader->normalizeMailboxes(Array) #2 C:\wamp\www\ssl\swift_emailer\lib\classes\Swift\Mime\Headers\MailboxHeader.php(60): Swift_Mime_Headers_MailboxHeader->setNameAddresses(Array) #3 C:\wamp\www\ssl\swift_emailer\lib\classes\Swift\Mime\SimpleHeaderFactory.php(60): Swift_Mime_Headers_MailboxHeader->setFieldBodyModel(Array) #4 C:\wamp\www\ssl\swift_emailer\lib\classes\Swift\Mime\SimpleHeaderSet.php(75): Swift_Mime_SimpleHead in C:\wamp\www\ssl\swift_emailer\lib\classes\Swift\Mime\Headers\MailboxHeader.php on line 308
Run Code Online (Sandbox Code Playgroud)

看着: …

php email swiftmailer

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

symfony1 swift mailer gmail - 连接拒绝

我有一个带有以下factories.yml文件的symfony1应用程序:

  mailer:
    param:
      delivery_strategy: realtime
      transport:
        class: Swift_SmtpTransport
        param:
          host:       smtp.gmail.com
          port:       465
          encryption: ssl
          username:   my.user@gmail.com
          password:   my_password
Run Code Online (Sandbox Code Playgroud)

密码和用户名是正确的,因为我可以使用它们只需登录到Gmail.我使用gmail smtp发送邮件时遇到symfony/swift邮件程序的问题.我正在提交正确的用户名/密码,但google阻止,说服务器在俄罗斯(提供IP),它说它不相信它等等等等,这是一次安全攻击.无论如何,这是我,我只想用gmail发送电子邮件.

原始的gmail警告电子邮件是波兰语,翻译版本如下:

最近有人使用您的密码登录您的Google帐户my.user @ gmail.com.此人已收到应用程序(如客户端电子邮件)或移动设备.

我们阻止了登录尝试,以防有人想要侵入您的帐户.看看这些信息:

2013年12月12日星期四8:13:15 UTC IP地址:62.212.65.74(s99.linuxpl.com.)位置:俄罗斯

如果您无法识别登录尝试,则其他人可能会尝试访问您的帐户.只要您登录并重置密码.

如果是您并且您在访问帐户时遇到问题,请按照http://support.google.com/mail?p=client_login上提供的问题排查说明进行操作

此致,Google客户团队

该链接解释了如何像雷鸟一样使用smtp客户端,但它没有提到像swift邮件这样的软件.

symfony调试环境显示以下错误代码:

Expected response code 250 but got code "530", with message "530-5.5.1 Authentication Required. Learn more at 
530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 a51sm103278568eeh.8 - gsmtp 
Run Code Online (Sandbox Code Playgroud)

有谁知道我能做什么?

php email gmail symfony1 swiftmailer

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

发送电子邮件时Laravel出现问题

当我尝试使用lavelvel中的swiftmailer发送电子邮件时,我得到以下错误:"缺少用户控件的参数2 :: {closure}()".

我的代码如下:

Mail::send('emails.default', array('key' => Config::get('settings.WELCOMEMAIL')), function($message, $mail, $subject = 'Welcome!')
{
    $message->to($mail)->subject($subject);
});
Run Code Online (Sandbox Code Playgroud)

这真的很奇怪.$ mail变量包含一个有效的电子邮件地址,我在这个脚本中根本没有使用UsersController.

提前致谢

php swiftmailer laravel

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

在Symfony2中的某些命令中通过控制器和假脱机中的内存发送电子邮件

我需要使用spool选项向我的用户发送大量的电子邮件,但我不会将我的应用程序的整个配置更改为假脱机,因为我的注册系统向用户发送了一封电子邮件,我希望这封电子邮件能够即时发送.

有没有办法在不更改swiftmailer的全局配置的情况下执行此操作?

memory email spool swiftmailer symfony

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

Symfony swiftmailer通过smtp gmail on localhost openssl错误

升级到php 5.6(mac os x sierra)后,我无法在本地测试环境中发送邮件.

但遗憾的是,在Symfony通过swiftmailer发送邮件是行不通的.

这是错误:

[Symfony\Component\Debug\Exception\ContextErrorException]
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
Run Code Online (Sandbox Code Playgroud)

我到现在才发现:

因为php 5.6 openssl似乎是一个要求:http://php.net/manual/en/migration56.openssl.php

因为在更新后我没有能够使用file_get_contents而没有这个错误,所以我做的是 在我的php ini中指定一个 openssl.cafile =就像我在这里找到的那​​样:https://andrewyager.com/2016/10/ 04/PHP-上的MacOS-Sierra公司-斜面存取SSL的数据/

现在file_get_contents再次工作,但我无法通过smtp发送swiftmailer邮件.

这是我的swiftmailer配置:

swiftmailer:

transport:        "smtp"
host:             "smtp.gmail.com"
username:         "%mailer_user%"
password:         "%mailer_password%"
auth_mode:        login
port:             587
encryption:       tls
delivery_address: "%mailer_delivery_address%"
spool:            { type: memory }
Run Code Online (Sandbox Code Playgroud)

我是否必须在symfony/swiftmailer的任何其他地方提供我的咖啡馆?

我已经发现了这个:PHP - 使用STARTTLS和自签名证书的Swiftmailer 但是硬编码这样的解决方案不是一个选项,因为我想部署代码库而不是每次都改变它.我更喜欢在系统级别上解决此问题.

php pyopenssl swiftmailer symfony

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

试图调用类的名为"getRequest"的未定义方法.Sendind电子邮件在SwiftMailer Symfony

我正试图在Symfony 3中发送SwiftMailer发来的电子邮件.我正在阅读该教程:http://tutorial.symblog.co.uk/docs/validators-and-forms.html#sending-the-电子邮件,我在"在控制器中创建表单"中遇到了问题:"尝试调用类"AppBundle\Controller\DefaultController"的名为"getRequest"的未定义方法."

这是我在src/AppBundle/DeffaultController中的contactAction():

/**
 * @Route("/contact"), name="cont")
 */
public function contactAction()
{

    $enquiry = new Enquiry();
    $form = $this->createForm(EnquiryType::class, $enquiry);

    $request = $this->getRequest();
    if ($request->getMethod() == 'POST') {
        $form->bindRequest($request);

        if ($form->isValid()) {
            // Perform some action, such as sending an email

            // Redirect - This is important to prevent users re-posting
            // the form if they refresh the page
            return $this->redirect($this->generateUrl('app_default_contact'));
        }
    }


    return $this->render(':default:contact.html.twig', array(
        'form' => $form->createView()
    ));
}
Run Code Online (Sandbox Code Playgroud)

请帮忙!

php email swiftmailer symfony

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

标签 统计

swiftmailer ×10

php ×8

email ×5

symfony ×4

smtp ×2

gmail ×1

laravel ×1

memory ×1

performance ×1

pyopenssl ×1

rabbitmq ×1

spool ×1

symfony1 ×1