Joomla 5 Notice

We are pleased to announce that as of January 29, 2024, all of our Joomla extensions are compatible with Joomla 5.

For all who are still updateing from Joomla 3 to Joomla 4: Joomla 4 Migration instructions are available here:

There is now a separate Documentation for Visforms for Joomla 4 and for Visforms for Joomla 5!

Forum

Visforms Subscription user can ask questions in our forum. Please log in with the relevant user first.
Everybody can access the forum for reading.

Please only ask 1 question per topic.

Important information for almost every question:
V1: Which Visforms version is running?
V2: Which Joomla version is running?
V3: Which PHP version is running?

SMTP error on submit, but only in Visforms

More
9 years 11 months ago - 9 years 11 months ago #1062 by carsten
First I want to give Visforms a big congratulations on making such a great extension. I'm migrating from chronoforms and have tried the 6 top form extension on the JED. This one is by far the best GUI (althou I have some tips to make that even better, I might post those later). If only I could make it send an email :(

On submit I get this error:

Attentie
SMTP fout! Verzenden naar de volgende ontvangers is mislukt: fjvhbfdjsh@zjhfdvsjdh.nl

SMTP serverfout: 5.7.1 : Client host rejected: Access denied

But the Joomla contact form also uses the SMTP settings as set in the Joomla config and sending mail with the normal Joomla contact form works fine. Also another extension send mail with that without problem. I've googled the error and found no solution. I've been pondering this for a few hours, but can't think of a solution.

I have tried with in the Joomla config 'php mail', which gives no error, but email never arrives. And 'sendmail' which on submit just gives a white screen (no code output at all).

Joomla 3.3.6 Visforms 3.1.1

How to solve this SMTP issue?
Last edit: 9 years 11 months ago by carsten.

More
9 years 11 months ago #1065 by Administrator AV
Replied by Administrator AV on topic SMTP error on submit, but only in Visforms
Hi Casten,

I was out of office yesterday. I will check into this as soon as possible.
If I need further information, I will let you know.

Regards,
Aicha

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).

More
9 years 11 months ago #1070 by Administrator AV
Replied by Administrator AV on topic SMTP error on submit, but only in Visforms
Hi Carsten,

I think I know, what the problem is.
Here a brief explanation.
When I started with Visforms the result mail used the parameters "email from" and "email from name" (from the form configuration) as mail from headers. That was awkward because you could not use the "answer" button of your email client to answer, but you had to copy the email adress form the mail text manually into the reply email.

As an "improvement" I made a change for the next release, which uses now the email address a user enters in the form als mail from header in the email. That allow you now to use the "answer" button in an email client but some mailer, especially SMTP mailer, may require, that the mail from header is consistant with your domain and if not consider the mail as spam. So this one isn't a really good one either

As there are obviously not so many mailer with this feature, the problem does not occure too often and as the error messages of the mailer are often just useless (I found this interessting article on google www.massmailsoftware.com/smtp/554-5-7-1.php ) it was difficutl to figure the problem, but with the help of one Visforms user it was possible some weeks ago. I just then realized, that there is a replyTo header., which I should use.

So in Visform 3.2.0 I changed the code once again. The replyTo header contains the user email and allows you to easily answer a result mail. The mail from headers contain the correct mail from which you set up in your configuration and which should be an email address with your domain in the address.

I do not want to push you to update to Visforms 3.2.0 for this is a beta and I rely on Visforms users to test it before I can savely say, you can use it on a productive system. But you can just make some small changes to the code of your 3.1.1 installation and I think this will (hopefully) solve your problem.

Open the file components/com_visforms/models/visforms.php and find the

private function sendResultMail($visform)

find the following code (it's the last function of the file and this code ist almost at the bottom of the file).
Code:
if ($emailSender == "") { $emailSender = $visform->emailfrom; } $mail->setSender( array( $emailSender, $visform->emailfromname ) );

and replace it with
Code:
$mail->setSender( array( $visform->emailfrom, $visform->emailfromname ) ); if ($emailSender != "") { $mail->addReplyTo($emailSender); }

Regards,
Aicha

:idea: I recommend you the new and up-to-date documentation for Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/en/docs/
Most of this also applies retrospectively to Joomla 3.
Please only ask 1 question per topic :-).

:idea: Ich empfehle Dir die neue und aktuelle Dokumentation für Joomla 4:
docs.joomla-5.visforms.vi-solutions.de/docs/
Das meiste gilt rückwirkend auch für Joomla 3.
Bitte immer nur 1 Frage pro Thema stellen :-).

More
9 years 11 months ago #1071 by carsten
Replied by carsten on topic SMTP error on submit, but only in Visforms
Thank you for your time.

unfortunately, that did not solve the issue.

I also tried with changing both the mail_from and mail_to adress to the main adress from the domain itself. Same result.

More
9 years 11 months ago #1072 by carsten
Replied by carsten on topic SMTP error on submit, but only in Visforms
I'm sorry to have bothered you with this.

It seems this is not a problem with visforms at all.

I tried this code which works fine on other sites, but not on this one domain. So the problem must be domain-specific.
Code:
$mailer = JFactory::getMailer(); $sender = array('webmaster@domain.com', 'test');//from mail and name $mailer->setSender($sender); $mailer->addRecipient('cljhbkjbne@domain.com'); $body = "Your body string\nin double quotes if you want to parse the \nnewlines etc"; $mailer->setSubject('Your subject string'); $mailer->isHTML(true); $mailer->setBody($body); $send = $mailer->Send(); if ( $send !== true ) { echo 'Error sending email: ' . $send->__toString(); } else { echo 'Mail sent'; }
sample code taken from docs.joomla.org/Sending_email_from_extensions

Still a mystery why the joomla contact form and another extension have no problem sending mail.

Moderators: Administrator AVAdministrator IV
Powered by Kunena Forum