【问题标题】:Symfony send-email task does not workSymfony 发送电子邮件任务不起作用
【发布时间】:2011-12-19 01:29:40
【问题描述】:

我在使用 Propel 1.6 (sfPropelORMPlugin) 的 Symfony 1.4.14 项目中发送邮件时遇到问题。当我尝试运行时: ./symfony project:send-emails --message-limit=2 --time-limit=20我收到错误:

PHP Warning:  call_user_func() expects parameter 1 to be a valid callback, class 'MailMessagePeer' does not have a method 'getSpooledMessages' in /srv/www/mailing/trunk/plugins/sfPropelORMPlugin/lib/mailer/Swift_PropelSpool.class.php on line 105

Warning: call_user_func() expects parameter 1 to be a valid callback, class 'MailMessagePeer' does not have a method 'getSpooledMessages' in /srv/www/mailing/trunk/plugins/sfPropelORMPlugin/lib/mailer/Swift_PropelSpool.class.php on line 105
PHP Warning:  Invalid argument supplied for foreach() in /srv/www/mailing/trunk/plugins/sfPropelORMPlugin/lib/mailer/Swift_PropelSpool.class.php on line 115

Warning: Invalid argument supplied for foreach() in /srv/www/mailing/trunk/plugins/sfPropelORMPlugin/lib/mailer/Swift_PropelSpool.class.php on line 115

这是我的 schema.yml:

  mail_message:
    message:    { type: blob, required: true }
    created_at: ~

factories.yml 的一部分:

all:
  routing:
    class: sfPatternRouting
    param:
      generate_shortest_url:            true
      extra_parameters_as_query_string: true

  mailer:
    class: sfMailer
    param:
      logging:           %SF_LOGGING_ENABLED%
      charset:           %SF_CHARSET%
      delivery_strategy: spool
      spool_class:       Swift_PropelSpool
      spool_arguments:   [ MailMessage, message, getSpooledMessages ]
      transport:
        class: Swift_SmtpTransport
        param:
          host:       smtp.mail.com
          port:       465
          encryption: ssl
          username:   myusername
          password:   mypass

【问题讨论】:

    标签: email symfony1 send propel spool


    【解决方案1】:

    您的 MailMessagePeer 类中有“getSpooledMessages”方法吗?

    在此处查看更多信息:

    http://www.symfony-project.org/gentle-introduction/1_4/en/11-Emails

    【讨论】:

      【解决方案2】:

      移除 ssl 加密并使用端口 25

      【讨论】:

        猜你喜欢
        • 2016-08-04
        • 2023-03-09
        • 2016-02-11
        • 2012-08-01
        • 2018-10-30
        • 2017-10-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多