Symfony 发送电子邮件任务不起作用

发布于 2024-12-21 18:01:57 字数 1807 浏览 3 评论 0原文

我在 Symfony 1.4.14 项目中使用 Propel 1.6 (sfPropelORMPlugin) 发送邮件时遇到问题。当我尝试跑步时: ./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

I have problems with sending mails in Symfony 1.4.14 project with Propel 1.6 (sfPropelORMPlugin). When I am trying to run:
./symfony project:send-emails --message-limit=2 --time-limit=20 I am getting errors:

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

This is my schema.yml:

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

Part of 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦情居士 2024-12-28 18:01:58

删除 ssl 加密并使用端口 25

remove ssl encryption and use port 25

苏大泽ㄣ 2024-12-28 18:01:57

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

在这里查看更多相关信息:

http://www.symfony-project .org/gentle-introduction/1_4/en/11-电子邮件

Do you have a "getSpooledMessages" method in your MailMessagePeer class?

See more about it here:

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文