2012-07-28 45 views
0

我已经安装了一个siwapp开票软件。它安装成功,但是当我试图用重复的个人资料,甚至发送发票给我的客户,就来到了一个错误说:为什么我不能用siwapp invoicing软件发送电子邮件?

Warning: fsockopen() [function.fsockopen]: unable to connect to localhost:25 (Connection refused) in /home/olepress/public_html/my/lib/vendor/symfony/lib/vendor/swiftmailer/classes/Swift/Transport/StreamBuffer.php on line 233 

Warning: Cannot modify header information - headers already sent by (output started at /home/olepress/public_html/my/lib/vendor/symfony/lib/vendor/swiftmailer/classes/Swift/Transport/StreamBuffer.php:233) in /home/olepress/public_html/my/lib/vendor/symfony/lib/response/sfWebResponse.class.php on line 336 

Warning: Cannot modify header information - headers already sent by (output started at /home/olepress/public_html/my/lib/vendor/symfony/lib/vendor/swiftmailer/classes/Swift/Transport/StreamBuffer.php:233) in /home/olepress/public_html/my/lib/vendor/symfony/lib/response/sfWebResponse.class.php on line 357 

Warning: Cannot modify header information - headers already sent by (output started at /home/olepress/public_html/my/lib/vendor/symfony/lib/vendor/swiftmailer/classes/Swift/Transport/StreamBuffer.php:233) in /home/olepress/public_html/my/lib/vendor/symfony/lib/response/sfWebResponse.class.php on line 357 

我试图寻找它,那里有很多类似我的问题的问题但我不确定我们是否使用相同的软件。试图播放这个软件的源文件,我发现这个配置文件包含:

test: 
    storage: 
    class: sfSessionTestStorage 
    param: 
     session_path: %SF_TEST_CACHE_DIR%/sessions 

    response: 
    class: sfWebResponse 
    param: 
     send_http_headers: false 

    mailer: 
    param: 
     delivery_strategy: none 

all: 
    routing: 
    class: sfPatternRouting 
    param: 
     generate_shortest_url:   true 
     extra_parameters_as_query_string: true 
    user: 
    class: SiwappUser 
    param: 
     timeout:   1800 
     logging:   %SF_LOGGING_ENABLED% 
     use_flash:  true 
     default_culture: %SF_DEFAULT_CULTURE% 

#all: 
# controller: 
# class: sfFrontWebController 
# 
# request: 
# class: sfWebRequest 
# param: 
#  logging:   %SF_LOGGING_ENABLED% 
#  path_info_array: SERVER 
#  path_info_key:  PATH_INFO 
#  relative_url_root: ~ 
#  formats: 
#  txt: text/plain 
#  js: [application/javascript, application/x-javascript, text/javascript] 
#  css: text/css 
#  json: [application/json, application/x-json] 
#  xml: [text/xml, application/xml, application/x-xml] 
#  rdf: application/rdf+xml 
#  atom: application/atom+xml 
# 
# response: 
# class: sfWebResponse 
# param: 
#  logging:   %SF_LOGGING_ENABLED% 
#  charset:   %SF_CHARSET% 
#  send_http_headers: true 
# 
# user: 
# class: myUser 
# param: 
#  timeout:   1800 
#  logging:   %SF_LOGGING_ENABLED% 
#  use_flash:  true 
#  default_culture: %SF_DEFAULT_CULTURE% 
# 
# storage: 
# class: sfSessionStorage 
# param: 
#  session_name: symfony 
# 
# view_cache: 
# class: sfFileCache 
# param: 
#  automatic_cleaning_factor: 0 
#  cache_dir:     %SF_TEMPLATE_CACHE_DIR% 
#  lifetime:     86400 
#  prefix:     %SF_APP_DIR%/template 
# 
# i18n: 
# class: sfI18N 
# param: 
#  source:    XLIFF 
#  debug:    false 
#  untranslated_prefix: "[T]" 
#  untranslated_suffix: "[/T]" 
#  cache: 
#  class: sfFileCache 
#  param: 
#   automatic_cleaning_factor: 0 
#   cache_dir:     %SF_I18N_CACHE_DIR% 
#   lifetime:     31556926 
#   prefix:     %SF_APP_DIR%/i18n 
# 
# routing: 
# class: sfPatternRouting 
# param: 
#  load_configuration:    true 
#  suffix:       '' 
#  default_module:     default 
#  default_action:     index 
#  debug:       %SF_DEBUG% 
#  logging:       %SF_LOGGING_ENABLED% 
#  generate_shortest_url:   false 
#  extra_parameters_as_query_string: false 
#  cache: 
#  class: sfFileCache 
#  param: 
#   automatic_cleaning_factor: 0 
#   cache_dir:     %SF_CONFIG_CACHE_DIR%/routing 
#   lifetime:     31556926 
#   prefix:     %SF_APP_DIR%/routing 
# 
# logger: 
# class: sfAggregateLogger 
# param: 
#  level: debug 
#  loggers: 
#  sf_web_debug: 
#   class: sfWebDebugLogger 
#   param: 
#   level: debug 
#   condition:  %SF_WEB_DEBUG% 
#   xdebug_logging: true 
#   web_debug_class: sfWebDebug 
#  sf_file_debug: 
#   class: sfFileLogger 
#   param: 
#   level: debug 
#   file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%.log 

我在这里错过了什么吗?我怎样才能解决这个问题?

+1

'无法连接到本地主机:25(连接被拒绝)'表示您没有邮件服务器在本地主机上运行,​​或者它没有监听端口25(可能是465或587)。你知道你想发送邮件吗(sendmail,本地smtp服务器,还是远程邮件服务器)? – drew010 2012-07-28 05:14:37

+0

对不起,我在这个问题上是新的,我不明白的过程。 – leojarina 2012-07-28 05:22:10

回答

0

检查该应用程序的配置:您必须配置使用哪个邮件服务器(smtp服务器)。给它一个使用其他软件时发送邮件的服务器的地址。

+0

我已经将配置更改为正确的登录信息,主机和端口,但问题仍然存在 – leojarina 2012-07-28 05:34:16

+0

那么,如果您指定了另一台smtp服务器,并且它仍然尝试连接到本地主机:25,那么您知道在哪里看:您的配置似乎被忽略。没有你给你提到的那些配置,我恐怕没有人可以评论它。 – arkascha 2012-07-28 05:54:01

0

如果你是在Linux上,尝试在服务器上安装的sendmail(于Debian/Ubuntu sudo apt-get install sendmail,(RHAT/CentOS的yum install sendmail)。

如果你有像Gmail或您的ISP外部SMTP服务器证书,你应该可以指定你发现配置文件中的主机的详细信息和凭据,请参阅文档sending mail in siwapp

可以使用SMTP与类似配置:

prod: 
    ... 
    mailer: 
    param: 
     delivery_strategy: realtime 
     transport: 
     param: 
      host: smtp.gmail.com 
      port: 465 
      encryption: ssl 
      username: [email protected] 
      password: your_gmail_password 

使用PHP的sendmail,使用的配置是这样的:

prod: 
... 
    mailer: 
    param: 
     delivery_strategy: realtime 
     transport: 
     class: Swift_MailTransport 

配置文件编辑为siwapp/config/factories.yml

希望有所帮助。

+0

我在共享主机上,是否仍可以解决此问题? – leojarina 2012-07-28 05:49:17

+0

如果你有共享主机,那么你应该可以发送邮件。请参阅编辑的答案,然后尝试使用sendmail。如果你愿意,你仍然可以使用SMTP。 – drew010 2012-07-28 05:54:53

+0

我有上面的siwapp/config/factories.yml配置,我不太确定把你的编辑代码放在哪里。请告知 – leojarina 2012-07-28 07:49:11

0

我知道这个线程是旧的,但我终于找到了解决这个非常加重的错误。

siwapp的安装说明有点...小,整个画面很难得到。我编译的平均时间

复制文件factories.yml中这些票据到你的config文件夹

cp <siwapp_root>/apps/siwapp/config/factories.yml <siwapp_root>/config/factories.yml

修改您的督促部分从而

prod: 
    ... 

    mailer: 
    param: 
     delivery_strategy: realtime 
     transport: 
     param: 
      host: smtp.gmail.com 
      port: 465 
      encryption: ssl 
      username: your_email_address[email protected] 
      password: your_password 

更换了地址的值和密码。

清空/ cache/*处的缓存(但不要删除目录本身!)以删除旧的配置。我之前遇到过这个问题,所以最好建议对缓存目录进行备份......

tar -czf siwappcachebkp.tgz <siwapp_root>/cache/*

要手动配置电子邮件,如果重建缓存由于某种原因失败,您需要专门修改此文件:

<siwapp_root>/cache/siwapp/prod/config/config_factories.yml.php

在文件的最后,你会发现邮件连接细节硬编码映射;输入正确的值,你会很好。

相关问题