Click 'Register' and don't receive email

Joomla version 1.0 is end-of-life and are no longer supported. Please use Joomla 3.x instead.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
richard.beatson
Joomla! Apprentice
Joomla! Apprentice
Posts: 24
Joined: Thu Aug 23, 2007 2:47 pm

Click 'Register' and don't receive email

Post by richard.beatson » Wed Apr 02, 2008 7:35 pm

Fasthosts upgraded from PHP4 to PHP5 recently without letting me know. I'm sure they didn't let anyone know but hey...

The result is that I receive no mail from the site. Currently I have the site configuration set to PHP Mailer. I called support who highlighted the problem but I'm really now sure what to do from here.

They pointed me to this page on their site: http://www.fasthosts.co.uk/knowledge-ba ... icle_id=70 so I guess I now have to update a file (class.phpmailer.php perhaps?)

The thing is... I don't really know where to start to change the script... should I have to change it in the first place as it was Fasthosts that caused this problem in the first place? I'm really confused...

Could someone who has more knowledge than me with PHP just point me in the right direction and let me know what needs to be updated in order that it's done correctly?

Thanks in advance.
Rich

 
barrydwise
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Jun 03, 2008 8:45 am

Re: Click 'Register' and don't receive email

Post by barrydwise » Tue Jun 03, 2008 8:48 am

I've come across the same problem - did you get a solution to it? I think it is to do with the -f parameter and sending emails from an account hosted on fasthosts.

I'm investigating and will post if I get any more info.

PITA

Barry

richard.beatson
Joomla! Apprentice
Joomla! Apprentice
Posts: 24
Joined: Thu Aug 23, 2007 2:47 pm

Re: Click 'Register' and don't receive email

Post by richard.beatson » Tue Jun 03, 2008 10:50 am

Barry, no I haven't found a solution to the problem. If you do find one then I would be most grateful for the solution. We're thinking of moving hosts because of it. Fasthosts have washed their hands of it as it's not their script.
Regards
Richard

david_hunter
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Sun Aug 10, 2008 11:38 am

Re: Click 'Register' and don't receive email

Post by david_hunter » Sun Aug 10, 2008 12:12 pm

I too fell foul of fasthosts changing the way you need to send email and not bothering to tell anyone. I have a fix for you though.

The file you want to change is indeed class.phpmailer.php (includes\phpmailer\class.phpmailer.php). I am currently running Joomla 1.0.15 so if you are using 1.5 the class maybe a little different, you should get the idea though.

You need to change the line

Code: Select all

$rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header);
which is on line 438
and change it to

Code: Select all

$email_from = "an_email@yourdomain.com";
ini_set("sendmail_from", $email_from);
//$rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header);
$rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header, '-f'.$email_from);
an_email@yourdomain.com needs to use your domain

That should do it, hope it helps

richard.beatson
Joomla! Apprentice
Joomla! Apprentice
Posts: 24
Joined: Thu Aug 23, 2007 2:47 pm

Re: Click 'Register' and don't receive email

Post by richard.beatson » Sun Aug 10, 2008 3:02 pm

Thanks for your response on this David. Client couldn't wait and has moved to a different server and a different CMS unfortunately. I hope your response helps other out.

Regards
Richard

barrydwise
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Tue Jun 03, 2008 8:45 am

Re: Click 'Register' and don't receive email

Post by barrydwise » Fri Oct 17, 2008 12:51 pm

Sorry David, I wasn't monitoring this forum and my colleague just mentioned that he'd seen your solution.

We've tried it and it worked for us so thanks very much.

Barry

designer156
Joomla! Apprentice
Joomla! Apprentice
Posts: 42
Joined: Sun May 17, 2009 1:00 am

Re: Click 'Register' and don't receive email

Post by designer156 » Thu Jun 04, 2009 6:53 pm

This actually works!

Fasthosts and joomla issue solved easily!

Thank you

steeom
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Oct 29, 2008 9:40 pm

Re: Click 'Register' and don't receive email

Post by steeom » Mon Aug 24, 2009 9:34 pm

This works for me too. Many Thanks. Spot ON !!

ReJigged
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Fri Aug 25, 2006 9:36 am
Location: Nottingham, UK

Re: Click 'Register' and don't receive email

Post by ReJigged » Tue Sep 01, 2009 9:33 am

I was looking for this solution and this does work with a tweak for 1.5.x and in a different file.

Find line 489 of the file /libraries/phpmailer/phpmailer.php

next find:

Code: Select all

$rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header);
and replace with:

Code: Select all

$email_from = "mail@yoursite.com";
ini_set("sendmail_from", $email_from);
$rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header, '-f'.$email_from);
//        $rt = @mail($to, $this->EncodeHeader($this->SecureHeader($this->Subject)), $body, $header);
making sure you use an email address from your fasthosts domain for the 'mail@yoursite.com'

And now users will receive activation emails!

BTW - out of all the hosts I am involved with, Fasthosts give me the most problems. So my advice is to steer clear. But if you have a client that won't move for whatever reason the above will work. But with it being a hack, each time you update the Joomla install you will have to re-hack this file if it also updated.

screaming_egg
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Aug 18, 2009 1:46 pm

Re: Click 'Register' and don't receive email

Post by screaming_egg » Fri Jan 15, 2010 3:39 pm

Brilliant, we've had this problem for a long time and this works like an absolute treat. Thankyou!

Jake7
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Mon Aug 30, 2010 5:11 pm

Re: Click 'Register' and don't receive email

Post by Jake7 » Fri Mar 04, 2011 12:11 pm

Thanks works a charm. This info is available on fasthosts knowledge base - http://www.fasthosts.co.uk/knowledge-ba ... le_id=1204

Unfortunately the info they give is incorrect. They say you only need to update phpmailer.php if you are on a windows server. My clients server is linux and still needed the phpmailer.php update before mail could be sent from any joomla form.

fatih0738
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Mon Mar 07, 2011 12:05 am

Re: Click 'Register' and don't receive email

Post by fatih0738 » Mon Mar 07, 2011 11:09 am

I've had the same problem, I solved the problem by reading .. unshared Thank you for sharing.

richard.beatson
Joomla! Apprentice
Joomla! Apprentice
Posts: 24
Joined: Thu Aug 23, 2007 2:47 pm

Re: Click 'Register' and don't receive email

Post by richard.beatson » Mon Mar 07, 2011 11:29 am

I think it is best to steer clear of Fasthosts for Joomla installations. I've used United Hosting for a couple of years now and had no problems with any Joomla sites I've done.

xdakotax
Joomla! Intern
Joomla! Intern
Posts: 87
Joined: Sun Jun 04, 2006 2:35 pm

Re: Click 'Register' and don't receive email

Post by xdakotax » Thu May 26, 2011 11:26 am

Thanks guys, this has had me stumped for hours.
Anyone considering Fasthosts to host their Joomla site don't bother - too many restrictions that end up eating your development time.

My client also insisted he remained with Fasthosts. Big thank you to you guys.
ReJigged's solution fixed the problem for me over the official FastHosts knowledge base.

pepsi28
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Jul 14, 2011 6:03 pm

Re: Click 'Register' and don't receive email

Post by pepsi28 » Thu Jul 14, 2011 6:09 pm

Are you using a dedicated server?

 

Locked

Return to “Upgrading - 1.0.x”