views:

195

answers:

1

Hi,

somehow sfMail doesn't want to send emails and I can't find the reaseon why. send() simply returns 0, here is my code:

$message = $this->getMailer()->compose("[email protected]", "[email protected]", "test", "testing");
echo $this->getMailer()->send($message);

factories.yml:

all:
  mailer:
    class: sfMailer
    param:
    logging:           %SF_LOGGING_ENABLED%
    charset:           %SF_CHARSET%
    delivery_strategy: realtime
    transport:
      class: Swift_SmtpTransport
      param:
        host:       smtp.email.com
        port:       25
        encryption: ~
        username:   [email protected]
        password:   mytestpass

and I simply get "0" as result. Any ideas what am I doing wrong?

UPDATE: in my Apache log I found this: "sendmail: Cannot open mail:25", I'm 100% sure that my smtp server is working just fine...

A: 

First of all in your params you have a host named smtp.email.com .. I don't think that is a legit host of yours. What Swift_SmtpTransport does is connects with the host and tries to send an e-mail with it's help via smtp. So be sure to get a proper SMTP configuration params from you server. The host and the port are important

Zoja
These are probably just example data for the purposes of posting to Stack Overflow.
Raise
could be, but that could also be the problem if copying from example
Zoja
it's just an example, I also don't have [email protected] as my email address... ;)
Cav