PHPMAILER_FROM_FAILED

Need help with the Administration of your Joomla! 1.5 site? This is the spot for you.

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
PiyushNahata
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Jun 26, 2008 6:18 pm

PHPMAILER_FROM_FAILED

Post by PiyushNahata » Thu Jun 26, 2008 6:26 pm

Hi,
I'm new to Joomla. I'm trying to setup the contact us page on my website for the past 2 days but without any success. I use Joomla 1.5. Whenever I try to send a mail, I get a PHPMAILER_FROM_FAILED exception returning back on the screen when using the SMTP server.

When using the PHP Mail Function or the SendMail, there is no error thrown but the mail also does not get sent. Under Contacts, I have a contact named administrator and a mail associated with him. I tried sending mails to the mail id associated with this user externally (through GMail) and am able to send it that way. Problem occurs only when using the contact us page of the website.

Can anyone guide me in this.

Regards,
Piyush

 
PiyushNahata
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Jun 26, 2008 6:18 pm

Re: PHPMAILER_FROM_FAILED

Post by PiyushNahata » Thu Jun 26, 2008 7:42 pm

I got the solution. I had not configured my mail server properly. Thats the reason I was getting that exception. Hope it is useful to someone else in future.

aristondarmayuda
Joomla! Apprentice
Joomla! Apprentice
Posts: 24
Joined: Wed May 24, 2006 9:37 am

Re: PHPMAILER_FROM_FAILED

Post by aristondarmayuda » Thu Sep 04, 2008 3:55 pm

Can you post the solution please, I have tired to find solution for Joomla SMTP server problem. I really need this solution so my site can be up on time.

Regards,

Ariston Darmayuda

seyedm
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Feb 19, 2009 9:08 am

Re: PHPMAILER_FROM_FAILED

Post by seyedm » Thu Feb 19, 2009 9:17 am

This is a mistake of variable definition in controller.php in contact component.
in controller.php of component contacts replace:
$mail->setSender( array( $email, $name ) )
with
$mail->setSender( array( $MailFrom, $FromName ) )

yaniesbe
Joomla! Apprentice
Joomla! Apprentice
Posts: 24
Joined: Fri Mar 21, 2008 10:15 am

Re: PHPMAILER_FROM_FAILED

Post by yaniesbe » Sat Feb 28, 2009 1:55 pm

Can you advise location of this controller.php file ..?

seyedm
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Feb 19, 2009 9:08 am

Re: PHPMAILER_FROM_FAILED

Post by seyedm » Sat Feb 28, 2009 2:38 pm

You can find this file in the following location:
domain.ext/httpdocs/components/com_contact/controller.php

coolbung
Joomla! Guru
Joomla! Guru
Posts: 552
Joined: Sat Nov 11, 2006 5:03 am
Contact:

Re: PHPMAILER_FROM_FAILED

Post by coolbung » Sat Mar 21, 2009 11:50 am

Sorry to resurrect an old topic, but I dont think it's an issue with the code. The code is correct.

The mail that the contact receives has the from address of the person who is sending the form.
The copy of the mail has the from name as set in the Global Config.

The error PHPMAILER_FROM_FAILED most probably occurs when you have set the mail sending method as SMTP, but your SMTP settings are incorrect. If you are trying to send using the Gmail SMTP, then there's no surefire way to do that yet without hacking some files.
Ashwin K. Date - Follow @coolbung @tekdinet @techjoomla @jugpune
Joomla! Extensions & Training - www.techjoomla.com

duyth
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Wed Apr 12, 2006 4:51 am

Re: PHPMAILER_FROM_FAILED

Post by duyth » Wed Mar 10, 2010 12:54 am

seyedm wrote:This is a mistake of variable definition in controller.php in contact component.
in controller.php of component contacts replace:
$mail->setSender( array( $email, $name ) )
with
$mail->setSender( array( $MailFrom, $FromName ) )
Confirmed works. This problem may come from the above error or from the misconfiguration of smtp.

anik369
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Dec 02, 2009 10:37 am

Re: PHPMAILER_FROM_FAILED

Post by anik369 » Wed May 05, 2010 9:10 am

Above methods is Not working for me... Need help...

agmichaca
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Jul 30, 2009 1:52 am

Re: PHPMAILER_FROM_FAILED

Post by agmichaca » Thu May 06, 2010 4:45 pm

Works for me I made 2 changes:

1. I modify the SMTP server to server name NO my domain name, you can get by this: <%="server_name"%>

2. I made the changes in controller.php as above instructions.

And works.
As I noticed this problems happends with Windows servers only, I dont have this problem in Linux Servers.

anik369
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Dec 02, 2009 10:37 am

Re: PHPMAILER_FROM_FAILED

Post by anik369 » Fri May 07, 2010 7:17 am

I am using RHEL 5.3 server not the windows server...

anik369
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Dec 02, 2009 10:37 am

Re: PHPMAILER_FROM_FAILED

Post by anik369 » Fri May 07, 2010 10:47 am

I am using Redhat Enterprise Linux Server. And all the above mentioned methods are not working for me. Any one there to solve my problem.

Thank you in advance.

Anik Ray

amy4snowsplash
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Fri Mar 12, 2010 11:44 am

Re: PHPMAILER_FROM_FAILED

Post by amy4snowsplash » Tue May 11, 2010 1:01 pm

hi, I did it. So I want to help others. Hence this post. I did the following and did not do any changes in the controller.php

step-1: In the global configuration settings-click on server and fill the email and from name of the email that you are filling in as follows:

Global Configuration->Server->Mail Settings:

Mailer: SMTP Server
Mail From: YourRegisteredEmail@godaddydomain.com
From Name: Above Email Name (as per ur wish)
Sendmail Path: /usr/sbin/sendmail
SMTP Authentication: No
SMTP Security: None
SMTP Port: 25
SMTP Username: (Must Be Blank!)
SMTP Password: (Must Be Blank!)
SMTP Host: relay-hosting.secureserver.net

step-2: Then come to the contact form software component that you are using. For me it is aicontact safe.
In the Profile-I use Default form.
Leave the "Email Address:" field blank and UNcheck the tick below for the "always send to this email address" field. Save the settings. You are done. If you hover over the help icon (if any) it would say that if the email field is left blank, it wud send mails to the default joomla ID---which would be the ID you entered in step-1

P.S.: I dont use the "send to sender field" I deleted it. so I dont have any problems regarding that. I think you can configure the autoresponder in such a way that it includes the received mail from the user so that you wont need the send to sender option.

anik369
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Dec 02, 2009 10:37 am

Re: PHPMAILER_FROM_FAILED

Post by anik369 » Thu May 13, 2010 9:10 am

I configured as you told, but nothing has been changed. The problem remains as it is. PHPMAILER_FROM_FAILED(email).
Any one there to solve my problem.

Thanks.

Anik

memius
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Jul 16, 2010 8:16 pm

Re: PHPMAILER_FROM_FAILED

Post by memius » Fri Jul 16, 2010 8:23 pm

I can confirm what seyedm says:

If you test the contact form, you will find (if your smtp is configured correctly) that the 'copy' option works, but the send mail to the administrator doesn't. You will see that there is a difference in the controller.php file for these two parts (and should actually have the same 'setSender' parameters.

memius
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Jul 16, 2010 8:16 pm

Re: PHPMAILER_FROM_FAILED

Post by memius » Fri Jul 16, 2010 9:05 pm

I downloaded version 1.5.19 and it seems that this line of code still exists ...
I think it is a bug, but if it is, it should have been found earlier, no ?
Maybe just exposed when smtp is chosen ?

anik369
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Dec 02, 2009 10:37 am

Re: PHPMAILER_FROM_FAILED

Post by anik369 » Mon Jul 19, 2010 6:48 am

Thanks to this thread, now my problem was solved... Thanks a lot to all the members who posted here... and gives their solutions...

Road Dog
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Sun Mar 01, 2009 7:37 pm
Location: Ocala, Fl
Contact:

Re: PHPMAILER_FROM_FAILED

Post by Road Dog » Thu Jul 29, 2010 10:37 am

This thread also helped me get mine working

http://forum.joomla.org/viewtopic.php?f ... 1#p2214281

Thank you

danielquinde
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Fri Oct 15, 2010 10:36 am

Re: PHPMAILER_FROM_FAILED

Post by danielquinde » Fri Oct 15, 2010 10:38 am

Thank You, this post was really helpful!

Slds

Daniel

User avatar
hannylicious
Joomla! Explorer
Joomla! Explorer
Posts: 292
Joined: Fri Feb 22, 2008 2:57 pm
Location: Chicago, IL
Contact:

Re: PHPMAILER_FROM_FAILED

Post by hannylicious » Mon Oct 18, 2010 6:48 pm

Is there any way around this without hacking core files that anyone has found?

I really, REALLY prefer to keep the core files as intended and try to keep from modifying them - however I suffer with this error when using a SOBI2 component.

The SMTP seems to be configured properly as the e-mails are going out, but this error keeps getting thrown up.
Pushpin Designs
www.pushpindesigns.com

smths
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Jan 19, 2011 4:41 pm

Re: PHPMAILER_FROM_FAILED

Post by smths » Wed Jan 19, 2011 4:57 pm

I only registered so I could reply to this thread and from the frustration that the original poster didn't actually mention how they resolved it.

As most people have noticed it is also near impossible to find a good explanation to this issue on the web. Anyway so I figured out why this problem occurs and what the best options are for resolving it. Even if this post is old, people still seem to have problems with it (as I did).

When a user submits a message through the contact form in Joomla the email will be sent to the email of the designated Contact. In the email Joomla will set the From: field to that specified by the person submitting the form.

However this won't work if you are using SMTP and your mailserver is setup to allow sending only emails with the sender email using a specifc domain. I assume this is a security setting you can set in the mail server.

I propose solving this in one of two ways:
1) Relax the settings on the mailserver so that it will allow sending emails with the Sender email set to any value.
2) In the file /components/com_contact/controller.php, replace the line
$mail->setSender( array( $email, $name ) );
with
$mail->setSender( array( $MailFrom, $FromName ) );

It might not be practical or possible to do 1) so the option 2) will make it so that emails sent to the Contact will look as if they are coming from the email address specified in the Global Configuration panel in the Joomla backend.

Hope this helps someone... :)

User avatar
torkil
Joomla! Guru
Joomla! Guru
Posts: 726
Joined: Wed Aug 24, 2005 9:34 am
Location: Rørvik, Norway
Contact:

Re: PHPMAILER_FROM_FAILED

Post by torkil » Tue Mar 01, 2011 12:01 pm

Very good explanation by smths!

I also got a suggestion that I should set up an SPF record in my DNS to validate the webserver as being a valid sender of e-mail for my domain, thus reducing the risk of having my e-mails caught in a spam filter.

If my domain was example.com, I could have this record:

example.com. IN TXT "v=spf1 a mx"

Here, you're saying that A and MX records are valid sender domains, which works fine when sending e-mail from your website (A).

Problem is, however, that when a person uses your contact form, the mail that is sent to you is sent FROM this persons mail address. So my SPF records on example.com won't have anything to say when a mail is sent from joeuser@foobar.com.

For this reason, the editing of /components/com_contact/controller.php is necessary. This will force your name and e-mail from configuration.php to be used as sender name and e-mail on contact forms too.

dereal7
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Mar 22, 2011 12:59 pm

Re: PHPMAILER_FROM_FAILED

Post by dereal7 » Tue Mar 22, 2011 1:07 pm

Hi,
sometimes free things are expensive thats what I've seen. I tried almost anything to have this contact form work, all in vain. tried changing controller.php all to no success.

Solution.
I had to buy a commercial component called contactenhanced. url:
http://ideal.fok.com.br/joomla-extensio ... anced.html . This will set you back about £15.
This worked like a charm. much as it is slightly expensive, it is worth every penny.
I love it.

When I finish making all the changes to my template. I will post the url to my new site.
But I can confirm that this solution worked for me.

All I had to do was install the module and the component, then create a contact where the contact mails will go and that was it.

Let me know if you need any more explanation.

mrlords
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Jan 19, 2012 7:09 pm

Re: PHPMAILER_FROM_FAILED

Post by mrlords » Tue Jan 24, 2012 12:30 pm

amy4snowsplash wrote:hi, I did it. So I want to help others. Hence this post. I did the following and did not do any changes in the controller.php

step-1: In the global configuration settings-click on server and fill the email and from name of the email that you are filling in as follows:

Global Configuration->Server->Mail Settings:

Mailer: SMTP Server
Mail From: YourRegisteredEmail@godaddydomain.com
From Name: Above Email Name (as per ur wish)
Sendmail Path: /usr/sbin/sendmail
SMTP Authentication: No
SMTP Security: None
SMTP Port: 25
SMTP Username: (Must Be Blank!)
SMTP Password: (Must Be Blank!)
SMTP Host: relay-hosting.secureserver.net

step-2: Then come to the contact form software component that you are using. For me it is aicontact safe.
In the Profile-I use Default form.
Leave the "Email Address:" field blank and UNcheck the tick below for the "always send to this email address" field. Save the settings. You are done. If you hover over the help icon (if any) it would say that if the email field is left blank, it wud send mails to the default joomla ID---which would be the ID you entered in step-1

P.S.: I dont use the "send to sender field" I deleted it. so I dont have any problems regarding that. I think you can configure the autoresponder in such a way that it includes the received mail from the user so that you wont need the send to sender option.

----


I got with this solution too. thank you

 

Locked

Return to “Administration 1.5”