Unit tests successful, smoke tests fail - empty sender field

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
pedalpete
Forum Newbie
Posts: 2
Joined: Thu Mar 06, 2008 1:14 pm

Unit tests successful, smoke tests fail - empty sender field

Post by pedalpete »

I'm using php5 with swiftmailer 3.3.2 connecting via smtp to gmail.

I've been trying to get the smoke tests working on my server. the Unit tests "all tests" works no problem, but the smoke test fails with the following error
"Error: The SMTP connection failed to start [tls://smtp.gmail.com:465]: fsockopen returned Error Number 13 and Error String 'Permission denied'
Log Information

++ Log level changed to 4
++ Forcing ESMTP mode. HELO is EHLO.
++ Forcing ESMTP mode. HELO is EHLO.
++ Trying to connect...
++ Trying to connect to SMTP server at 'tls://smtp.gmail.com:465
!! The SMTP connection failed to start [tls://smtp.gmail.com:465]: fsockopen returned Error Number 13 and Error String 'Permission denied'
"

I have tried both ssl and tls connections, and neither was successful.
The interesting thing is that looking at the output from basic send, the sender and sendto fields are blank (which is a hint to the problem

"A basic, 7 bit ascii email will be sent from Swift, to the account given in the test configuration. Simply open up the email and check that the details given below are accurate:

* The subject of the message is "Smoke Test 1 - Basic"
* The sender of the message is ""
* The recipient in the To: header is ""
* The message body is
"This is just a basic test
It has two lines and no special non-ascii characters."
* The Date: header relects the date on the server.
".

However, I have provided this data in the testconfiguration.php
Here is the testconfiguration, though I have edited my e-mail address and password.

Code: Select all

 
   * The location of the Swift library directory
   */
  const SWIFT_LIBRARY_PATH = DEFAULT_LIBRARY_PATH;
  /**
   * The location of some files used in testing.
   */
  const FILES_PATH = FILES_PATH;
  
  /*
   * EVERYTHING BELOW IS FOR SMOKE TESTING ONLY
   */
   
  /**
   * The connection tye to use in testing
   * "smtp", "sendmail" or "nativemail"
   */
  const CONNECTION_TYPE = "smtp";
  /**
   * An address to send emails from
   */
  const FROM_ADDRESS = "pete@mydomain.com";
  /**
   * The name of the sender
   */
  const FROM_NAME = "Pete Field - from";
  /**
   * An address to send emails to
   */
  const TO_ADDRESS = "pete@otheraddress.com";
  /**
   * The name of the recipient
   */
  const TO_NAME = "Pete Field- to";
  
  /*
   * SMTP SETTINGS - IF APPLICABLE
   */
   
  /**
   * The FQDN of the host
   */
  const SMTP_HOST = "smtp.gmail.com";
  /**
   * The remote port of the SMTP server
   */
  const SMTP_PORT = 465;
  /**
   * Encryption to use if any
   * "ssl", "tls" or false
   */
  const SMTP_ENCRYPTION = "tls";
  /**
   * A username for SMTP, if any
   */
  const SMTP_USER = "pete@mydomain.com";
  /**
   * Password for SMTP, if any
   */
  const SMTP_PASS = "password";
  
  /*
   * SENDMAIL BINARY SETTINGS - IF APPLICABLE
   */
  
  /**
   * The path to sendmail, including the -bs options
   */
  const SENDMAIL_PATH = "/usr/sbin/sendmail -bs";
}
 
Am I missing somethign?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: Unit tests successful, smoke tests fail - empty sender field

Post by Chris Corbyn »

The empty sender is probably because it couldn't connect so the tests never got as far as looking up the sender address. The socket connection to Gmail was refused by your host.
"Error: The SMTP connection failed to start [tls://smtp.gmail.com:465]: fsockopen returned Error Number 13 and Error String 'Permission denied'
I'd suggest asking your host why you can't establish socket connections on port 465... obviously there's a firewall rule somewhere which is blocking it.

1and1 and GoDaddy are no-go's unfortunately..... too strict on their shared plans.
pedalpete
Forum Newbie
Posts: 2
Joined: Thu Mar 06, 2008 1:14 pm

Re: Unit tests successful, smoke tests fail - empty sender field

Post by pedalpete »

Thanks for the speedy response,
I'll contact my host and see what's up with that.

I'm sure you probably get that question all the time, and I saw the notes regarding the issues with host.

I thought that because the to and from where blank, it wasn't being input before sending.

It help take some load off you answering this question repeatedly if you post a screenshot of what that error looks like.
Here's my screenshot to save you the time of having to change settings and capture it yourself.

Image
Post Reply