CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • PHP sendmai() vs SMTP mail ?
Pages: [1]

Author Topic: PHP sendmai() vs SMTP mail ?  (Read 7765 times)

Denver Dave

  • Ask me questions
  • ****
  • Posts: 471
  • Karma: 9
PHP sendmai() vs SMTP mail ?
November 02, 2007, 10:26:41 pm
Just curious what the ramifications are of using PHP sendmail vs SMTP mail.  I never used a server side application that used smtp mail to send before.   Is this an option?  Only see settings for the smtp mail within CiviMail.

Thanks - might be useful for my other applications.

phani

  • I’m new here
  • *
  • Posts: 28
  • Karma: 3
    • namahatta.org DB
Re: PHP sendmai() vs SMTP mail ?
November 03, 2007, 09:18:01 am
not only CiviMail, even sending plain mail out of CiviCRM seems, on the surface, only possible via SMTP. a couple of years ago i tried an earlier version of CiviCRM and gave up because of this - my (shared) host doesn't provide SMTP access.

after trying SugarCRM, which provides a sendmail option, but finding it too bloated, i came back to CiviCRM with ver. 1.9, and this time around i found the setting in /CRM/Core/Config.php, which allows me to use sendmail instead. don't know if it was there all along ...

sendmail works fine, at least for CiviCRM; i didn't try using CiviMail yet because i'm suing PHPlist as a list-server and am planning to integrate that with CiviCRM.

i'm also wondering if there's a reason that only SMTP is documented; will horrible things happen to me after switching to sendmail?

phani.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: PHP sendmai() vs SMTP mail ?
November 03, 2007, 12:23:36 pm

I'm pretty sure we dont support sendmail without code modifications. Its a simple code modification (in CRM/Core/Config.php) and should not affect CiviCRM sending mail. It will have an impact on CiviMail since we use SMTP's feature of fastbounce etc to trap some bounces (and am not sure how sendmail / php mail handle similar situations)

It is highly unlikely that we will support another mail delivery mechanism (php-mail / sendmail).

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Denver Dave

  • Ask me questions
  • ****
  • Posts: 471
  • Karma: 9
Re: PHP sendmai() vs SMTP mail ?
November 05, 2007, 10:32:43 am
What I expected to hear was something along the lines of SMTP email has a better acceptance rate though the spam filters than sendmail() (I'm not sure whether this is true or not). 

Also, if we use CiviMail for other domains, this may be best to actually use the other domains email server.

As for using sendmail()
Line 40:  require_once 'Mail.php';

And a search for smtp of the config.php returns lots of lines with smtp in them.

If I can get smtp to work, I'll use it and consider with my other applications.  Anyone else at this point on a virtual host (shared hosting)?
« Last Edit: November 05, 2007, 10:55:52 am by Denver Dave »

phani

  • I’m new here
  • *
  • Posts: 28
  • Karma: 3
    • namahatta.org DB
Re: PHP sendmai() vs SMTP mail ?
November 05, 2007, 11:30:16 am
Mail.php has to be included whether you use SMTP or sendmail.

in order to use sendmail for the email-functions in CiviCRM you have to change line 916 of /CRM/Core/Config.php from
Code: [Select]
self::$_mail =& Mail::factory( 'smtp', $params );to
Code: [Select]
self::$_mail =& Mail::factory( 'sendmail', $params );
to make this work with CiviMail, you'll have to install additional packages as described here in this wiki-article.

Denver Dave

  • Ask me questions
  • ****
  • Posts: 471
  • Karma: 9
Re: PHP sendmai() vs SMTP mail ?
November 05, 2007, 12:16:46 pm
Well that doesn't sound that bad.  If we use sendmail() how does this relate to the alternate installation steps discussed here:
http://wiki.civicrm.org/confluence/display/CRMDOC/Alternative+configuration+-+no+Amavis+or+root+access

Also, I'm wondering if sendmail() will help with the issues discussed on post:
http://forum.civicrm.org/index.php/topic,1501.0.html

Or if I'm just going to end-up with the same issues another way.

At the moment, CiviMail seems pretty hopeless for my level of expertise.  See discussions of perl modules, soap installations, rebuilding php ....

Shouldn't we be able to trigger the script called from the cron job manually as a test?


phani

  • I’m new here
  • *
  • Posts: 28
  • Karma: 3
    • namahatta.org DB
Re: PHP sendmai() vs SMTP mail ?
November 05, 2007, 12:32:33 pm
i haven't tried the 'alternative configuration' yet because i don't think i'll need CiviMail for what i'm doing. as far s i can see, though, it should work with sendmail, too.

perhaps some changes will be necessary, since, as lobo wrote, CiviMail utilizes some fast-bounce feature of SMTP, which i know nothing about. shouldn't be too difficult to disable the use of this feature, or adapt it to whatever sendmail can do.

installing the soap-script or hacking the CiviMail files isn't something i would call trivial if you don't know PHP and linux system management pretty well.

Denver Dave

  • Ask me questions
  • ****
  • Posts: 471
  • Karma: 9
Re: PHP sendmai() vs SMTP mail ?
November 07, 2007, 09:16:47 am
I've tried an independent test of SMTP on my shared hosting environment using this test script:
http://email.about.com/od/emailprogrammingtips/qt/et073006.htm

The complexity of using seemed similar between SMTP and sendmail() - basically fill out the parameters and call a mail sending script that is provided as part of our environment.  Wonder what the pro's and cons are for each approach.

However, does not look like my shared hosting environment works with SMTP, so something else must be stopping my mail.  .... Digging deeper.
- - - - -
later update - smtp works find on my shared host - I was changing the wrong settings file for the password
« Last Edit: December 18, 2007, 03:45:16 pm by Denver Dave »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • PHP sendmai() vs SMTP mail ?

This forum was archived on 2017-11-26.