Sorry, email-gateways/email.sendmail.php

Have you tried using SMTP?

Like @brendo pointed out, you can run into problems with Sendmail. When we developed the Sendmail gateway in Symphony, we noticed that different machines behave differently (especially when it comes to line breaks). We tried to find a way to please most of them, but there is simply no chance to please them all. I always suggest to use SMTP.

If the above is your problem, using SMTP might fix the issue without any hacking! If SMTP doesn't help, please report back.


I think this is issue you (and I) have been encountering:

If messages are not received, try using a LF (\n) only. Some poor quality Unix mail transfer agents replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with » RFC 2822. From mail()

In which case the fix is simple, change this \r\n to be \n.

These comments are interesting. Perhaps we should use PHP_EOL?

@michael-e is right though, SMTP is preferred when available!

@brendo, especially the first comment you reference to is very interesting, even though this would require some testing.

Does the problem only happen with sendmail, or is SMTP also having this issue?

Well, I don't agree with the comment which has been referenced. As far as I understand the phenomenon, it can not be boiled down to an OS thingie. I have tried several Linux systems which worked perfectly well with \r\n. So it seems to me that this is the "ideal situation" – a Sendmail socket being configured so that it accepts \r\n separators without changing changing them.

I don't think that this leads to a solution. If we want to help those (obviously misconfigured — see PHP manual) Sendmail sockets, we have to introduce an additional preference:

  • use \r\n separators for header fields (RFC 2822) – default
  • use \n separators for header fields

Since the above would be an "expert setting", we might even think about hiding it in the Symphony preferences to not confuse users. Exposing the setting on the prefs page might make things even worse.

Reading more about it seems to indicate that bad Qmail servers are the cause of the error. They blindly encode the headers with \r\n so we get a double encoding. Hence in the code just having \n will be encoded correctly as \r\n before sending. It only seems to happen when using sendmail for me, but our SMTP sites use Google Apps, so you would imagine they would do it right :)

ok, tnx for your help!

When trying to create a Newsletter in conjunctions with the ENM, I get the following error while trying to preview a plain-text email:

<br />
<b>Fatal error</b>:  Call to a member function get() on a non-object in <b>/…/extensions/email_template_manager/lib/class.emailtemplate.php</b> on line <b>246</b><br />

Something must have happened, since it was working in the first place. :(

What have I broken? (my setup is attached)

Bildschirmfoto 2012-01-04 um 13.18.09.png and Bildschirmfoto 2012-01-04 um 13.17.56.png

Hmm, got rid of the error by deleting, and redoing the template. Sorry to bother.

Hmm. that is a very very weird error. The line the error refers to is this one:

if(is_a($author, 'Author')){
    $rcpts[trim($author->get('first_name') . ' '. $author->get('last_name'))] = $author->get("email");

As you can see, I explicitly ask PHP if the $author is an Author object, and it first sais it is, to whine it isn't an object at all later..

Very strange.

It might have been a problem with a renamed datasource, but I’m not sure anymore.

I've been using Symphony for a couple of months and it is a wonderful thing, this is my first post on these very helpful forums though.

I'm using Email Template Manager for a contact form and would like to add the option for the user to attach a file. Is this possible, if so does anyone have an example they would mind sharing?

I'm using Email Template Manager for a contact form and would like to add the option for the user to attach a file. Is this possible, if so does anyone have an example they would mind sharing?

I am not really sure what you are trying to do: are you trying to let the user fill in the form, attach a file and have the ETM send you an email saying: "User x has uploaded a file, you can look it up here [link to the file]", or are you trying to actally email the file to you as an attachment?

If you are trying to do the first: this is relatively easy. All you need to do is include the upload field in your xml, and the rest is pretty straight forward if you follow the tutorial on github.

If you are trying to email the file as an attachment: this is a bit more tricky. The possibility for attachments is built into the core email API, which is what the ETM uses to send the email, but I have not written a wrapper or gui around it. This means you will have to get your hands dirty and write a custom event...

It's the latter - email the file as an attachment. Looks like I'd better start writing my first custom event! Will let you know how I get on.

This extension is great. Thank you, Huib!

I don't know if i missed something obvious, but i can't seem to find how to set the 'from:' value. in the send email.
This is standard set to 'from: Symphony <noreply@websiteadress>'
Where can i change these values?

System -> Preferences

Thanks!, i did miss something obvious :)

Awesome extension. Very helpful for me. Thanks!

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details