Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2010-09-19 20:58:00
- immarabi
- Member
- Registered: 2008-04-29
- Posts: 57
configuring smtp mail for textpattern
I am trying to configure the textpattern email system for smtp. Adding a SMTP envelope sender address did not help sending emails through the system. I edited the txplib_misc.php file following the instructions on this forum post
However, when I request a new password I get an error on the screen that says “Email was not sent”. However, the email was sent. When I click on the link in my email, it opens the textpattern logon page and says a similar error even though the new password WAS sent to my email.
Does anyone know how I can stop triggering the false error messages?
Thank you very much.
Offline
Re: configuring smtp mail for textpattern
change this:
if(!$mail->Send()) {
echo "<!-- Nasty error : " . $mail->ErrorInfo ." -->\n"; // Debug
} else {
echo "<!-- Email Sended -->\n";
}
into:
if(!$mail->Send()) {
return FALSE;
} else {
return TRUE;
}
or perhaps even (assuming $mail-Send() returns TRUE or FALSE):
return $mail->Send();
Offline
#3 2010-09-19 21:30:50
- immarabi
- Member
- Registered: 2008-04-29
- Posts: 57
Re: configuring smtp mail for textpattern
works wonders. Thank you. Thank you.
Offline
#4 2014-04-22 15:26:36
- AmySmile
- New Member
- Registered: 2014-04-22
- Posts: 2
Re: configuring smtp mail for textpattern
Hello, I’m trying to my smtp mail to work, so far I’ve been without contact with my textpattern for the last couple of months since my hoster decided he didn’t want php mail function due to spam…
The problem here is that the webfraction page doesn’t exist anymore, so does anyone have an explanation on how to get it done?
Offline
Re: configuring smtp mail for textpattern
Are you sure that’s the problem? Sendmail was enabled on webfaction several years ago, so it should no longer be necessary to modify txplib_misc.php. The forum post was from the old forum (was available for several years but now offline) but you can mail webfaction support and they’ll dig it out for you).
TXP Builders – finely-crafted code, design and txp
Offline
Re: configuring smtp mail for textpattern
AmySmile wrote #280344:
Hello, I’m trying to my smtp mail to work, so far I’ve been without contact with my textpattern for the last couple of months since my hoster decided he didn’t want php mail function due to spam…
The problem here is that the webfraction page doesn’t exist anymore, so does anyone have an explanation on how to get it done?
I have to use the method previously described in the Webfaction forum on another host where Sendmail in’t supported.
Download this file and unzip it. It’s called pearmail.php and contains instructions on how to use it to set up SMTP on a TXP installation.
- Edit the top section of the code to reflect your domain’s SMTP server login details and place a copy of the file in the textpattern/lib folder.
- If setting the “SMTP envelope sender address” in TXP preference doesn’t enable mail to be sent from your TXP user password system: Edit the lib/txplib_misc.php file (after backing it up!) as described in the Pearmail.php file’s instructions. Note that the line numbers quoted in the instructions refer to an older version of txplib_misc.php. It’s not a massive task, it involves adding a
require_once "pearmail.php";
in the appropriate section and replacing instances ofmail($to_address...,
withsmtp($to_address....
. Search on ‘mail($to’ to find them. They are around line 1180. - Even If the “SMTP envelope sender address” preference works for you, you will need to edit TXP plugins like ZCR that use Sendmail. It’s the same process, add
require_once "pearmail.php";
at the head of any section of the file that uses the mail() function and replace instances ofmail($to_address...,
withsmtp($to_address....
.
Offline
Re: configuring smtp mail for textpattern
jakob wrote #280354:
Are you sure that’s the problem? Sendmail was enabled on webfaction several years ago, so it should no longer be necessary to modify txplib_misc.php. The forum post was from the old forum (was available for several years but now offline) but you can mail webfaction support and they’ll dig it out for you).
AmySmile isn’t on WebFaction, I believe:
my hoster decided he didn’t want php mail function due to spam
Sound that Amy is on a separate hosting provider that has disabled mail()
or remove sendmail compatible endpoint.
AmySmile wrote #280344:
The problem here is that the webfraction page doesn’t exist anymore, so does anyone have an explanation on how to get it done?
I would recommend changing hosting provider. Disabling PHP’s mail or removing sendmail doesn’t prevent spam, and definitely isn’t the correct option. What he should have done, is to setup quotas, configure sendmail user access etc.
joebaich wrote #280357:
Download this file and unzip it. It’s called pearmail.php and contains instructions on how to use it to set up SMTP on a TXP installation.
Its designed for WebFaction’s setup though. It does have external dependencies, for instance, it requires PEAR and PEAR::Mail module, which you will have to install before you can use that script.
If you must hack Textpattern, I would recommend using PHPMailer instead. It’s actively developed, pure-PHP (no external dependencies) SMTP client implementation.
Last edited by Gocom (2014-04-23 11:56:04)
Offline
Re: configuring smtp mail for textpattern
just to be clear sendmail / smtp etc all work just fine on webfaction hosting environment using Textpattern or any other app.
…. texted postive
Offline
Re: configuring smtp mail for textpattern
Gocom wrote #280362:
Its designed for WebFaction’s setup though. It does have external dependencies, for instance, it requires PEAR and PEAR::Mail module, which you will have to install before you can use that script.
If you must hack Textpattern, I would recommend using PHPMailer instead. It’s actively developed, pure-PHP (no external dependencies) SMTP client implementation.
You are right, of course but to be more precise, I think, it’s designed for any setup that has PEAR and PEAR::Mail installed. WebFaction does have it installed as do other hosting companies including the one I use. That’s more by luck than good judgement on my part.
I am a designer and not a hacker, I couldn’t hack my way out of a wet paper bag. So absent of an idiot’s guide on how to integrate PHPMailer into TXP to provide SMTP capability, I can’t use it. I haven’t been able to find one and so the pearmail.php file has been my ‘go to solution’ for getting TXP plugins that rely on Sendmail to work for some time now. The ‘SMTP envelope sender address” preference works for me, so I don’t have to ‘hack Textpattern’ per se, usually, just the ZCR plugin.
Last edited by joebaich (2014-04-23 20:38:53)
Offline
Re: configuring smtp mail for textpattern
joebaich wrote #280376:
I think, it’s designed for any setup that has PEAR and PEAR::Mail installed.
That’s what I was referring to. It has external dependencies in terms of PEAR (which is distributed with PHP — compiles from same source repository, but is separate application) and PEAR::Mail which you can install with PEAR:
$ pear install Mail
Offline
#11 2014-04-28 10:03:19
- AmySmile
- New Member
- Registered: 2014-04-22
- Posts: 2
Re: configuring smtp mail for textpattern
Gocom wrote #280362:
Sound that Amy is on a separate hosting provider that has disabled
mail()
or remove sendmail compatible endpoint.I would recommend changing hosting provider. Disabling PHP’s mail or removing sendmail doesn’t prevent spam, and definitely isn’t the correct option. What he should have done, is to setup quotas, configure sendmail user access etc.
Its designed for WebFaction’s setup though. It does have external dependencies, for instance, it requires PEAR and PEAR::Mail module, which you will have to install before you can use that script.
If you must hack Textpattern, I would recommend using PHPMailer instead. It’s actively developed, pure-PHP (no external dependencies) SMTP client implementation.
Hi there,
Thank you all for replying, it is indeed so that I’m not on Webfraction, I wasn’t aware that is was like a thing, I just thought it was the solution to the problem I’m having, I’m not going to change my hoster, because it’s a really good friend who does it and I pay not much for unlimited everything…
The problem is that I do not know how to hack textpattern, I’m not really experienced with that kind of stuff… Somehow the textpattern integrated option isn’t working…
Offline