Hi,

I have a problem with SwiftMailer. Impossible to send with the option PHP Mail().

The function works again if I modify SimpleMailInvoker.php (line 34):

if (!ini_get('safe_mode')) {
  return @mail($to, $subject, $body, $headers, $extraParams);
}

to

if (!ini_get('safe_mode')) {
   return @mail($to, $subject, $body, $headers);
}

$headers seems to be the origin.

Do you have an idea?

Thanks!

Djulia

Hey Djulia, 

I've not seen this issue before, what error message are you receiving when the message is sent? 

Thanks,

Greg

Greg Thomas
PHP Programmer - interactivetools.com

By Djulia - August 5, 2016 - edited: August 5, 2016

Hi Greg,

There is no error message. But the message is not sent.

This post helped me to find the origin :
http://stackoverflow.com/questions/10617552/swiftmailer-does-not-send-mail-why

I am on a new server, I think as it is related to the configuration of this server and safe_mode.

Thanks!

Djulia

In fact, the function mail() works correctly on the server. It is a problem only with SwiftMailer.

Thanks, Djulia

By Djulia - August 5, 2016 - edited: August 5, 2016

I think that it is a problem with sendmail_path on server (or sendmail).

This works :

mail('name@domain.com', 'My subject', 'My message...', null, null);

not this :

mail('name@domain.com', 'My subject, 'My message...', null, '-fname@domain.com');

Do you think that it is possible to add NULL for the additional_parameters in cmsB?

Thanks!

Djulia

Hi Djulia, 

Do you think that it is possible to add NULL for the additional_parameters in CMSB?

You could customize your version of CMS Builder so that it has this parameter in. 

I'll pass this issue on to Dave, I don't think we'd add this fix into the current release of CMS Builder, as the oldest version of PHP it supports is version 5.5 or later, and Safe Mode was removed from version 5.4 of PHP:

http://php.net/manual/en/ini.sect.safe-mode.php#ini.safe-mode

You could also try asking your host to disable PHP Safe Mode to resolve the issue.

Thanks,

Greg

Greg Thomas
PHP Programmer - interactivetools.com