Search…

X3 Photo Gallery Support Forums

Search…
 
ckishappy
Topic Author
Posts: 20
Joined: 21 May 2016, 06:07

Contact Form / Unable to send mail

21 May 2016, 12:12

Hi, not sure exactly when the contact form stopped to work...I did the 0.17 and 0.18 updates flawlessly (thanks!) but didn't check whether the contact functionality really was working after each upgrade. And to make things worse: my ISP changed the mail server in between as well.. Initially the contact form worked very well, easy to implement. Having said this all, I don't get the contact form to work anymore. The user is always getting the red X / the mail does not go through. I didn't change anything in the contact form so I wonder what has changed with 0.18? Any advise?

Affected URL: http://polaschin.ch/Kontakt/
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

Re: Contact Form / Unable to send mail

21 May 2016, 12:24

Code
2016-05-21 16:18:25	Connection: opening to ssl://polaschin.ch:465, timeout=300, options=array ()
2016-05-21 16:18:25	SMTP ERROR: Failed to connect to server:  (0)
2016-05-21 16:18:25	SMTP connect() failed.
Message could not be sent.Mailer Error: SMTP connect() failed.
Looks like some server connection error. Port number? SSL settings? I would recommend you check exactly with your host what SMTP details you should use for send. Also, did you set a from address?

Not sure how well this tool works, but you could try it:
http://smtper.nanogenesis.fr/
 
ckishappy
Topic Author
Posts: 20
Joined: 21 May 2016, 06:07

Re: Contact Form / Unable to send mail

21 May 2016, 17:13

Hi, many thanks for your reply. I thought the same as well....but if I setup 0.181 in another domain (did it with chriskeller.ch) with exactly the same SMTP settings, the very same contact form works flawlessly! I did check the smtp settings with an email client and it works well. So I wonder what the difference is between a fresh install of 0.181 and and an upgrade. The contact form reads as following, and I was wondering if the terminology and " signs are still ok?


<form data-abide class=contactform>
<div class=honey>
<input type="text" class=honey1 name=honey1 placeholder=honey1>
</div>
<div class=honey>
<input type="text" class=honey2 name=honey2 placeholder=honey2 value="googooforgaga">
</div>
<div>
<input required type=text name="name" placeholder="Vorname Name">
</div>
<div>
<input required type="email" name="email" placeholder="Email">
</div>
<div>
<textarea required name="message" placeholder="Mitteilung"></textarea>
</div>
<button type=submit>Senden</button>
</form>
 
ckishappy
Topic Author
Posts: 20
Joined: 21 May 2016, 06:07

Re: Contact Form / Unable to send mail

21 May 2016, 18:00

Quick Update:

I have the same 0.181 version on chriskeller.ch and polaschin.ch. I did a new install for chriskeller.ch and copied the content over to polaschin.ch. for chriskeller.ch I can send the email/contact form and for polaschin.ch. From an ISP perspective both are using the the same php / apache settings.. Any idea?
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

Re: Contact Form / Unable to send mail

22 May 2016, 01:11

ckishappy wrote:I have the same 0.181 version on chriskeller.ch and polaschin.ch. I did a new install for chriskeller.ch and copied the content over to polaschin.ch. for chriskeller.ch I can send the email/contact form and for polaschin.ch. From an ISP perspective both are using the the same php / apache settings.. Any idea?
Same X3 settings, same server environment, but not exactly the same server. Works on one, but not the other, so it would be related to something on one server. My guess is that it's either missing openSSL extension, or it's a firewall issue.

Can you login to your panel, and check tools -> phpinfo, search for openSSL:
Image

Can you enable smtp debugging at bottom of smtp settings?
Image

We use the industry-standard PHPmailer for sending mail.
https://github.com/PHPMailer/PHPMailer/ ... leshooting
"SMTP Error: Could not connect to SMTP host."
This may also appear as SMTP connect() failed or Called Mail() without being connected in debug output. This is often reported as a PHPMailer problem, but it's almost always down to local DNS failure, firewall blocking or other issue on your local network. It means that PHPMailer is unable to contact the SMTP server you have specified in the Host property, but doesn't say exactly why. It can also be caused by not having the openssl extension loaded (See encryption notes below).
I also seem to remember you were using SSL and port 465?
As for what kind to use, the answer is generally simple: Don't use SSL on port 465, it's been deprecated since 1998 and is only used by Microsoft products that didn't get the memo; use TLS on port 587 instead:
I also see the server that doesn't work is PHP 5.6:
PHP 5.6 certificate verification failure
In a change from earlier versions, PHP 5.6 verifies certificates on SSL connections. If the SSL config of the server you are connecting to is not correct, you will get an error like this:
If you enable debug, we might be able to catch the exact reason. You can use the developer tools -> network inspector in your browser to view the loaded mailer file, and read the debug output by clicking it.
 
ckishappy
Topic Author
Posts: 20
Joined: 21 May 2016, 06:07

Re: Contact Form / Unable to send mail

22 May 2016, 11:25

Solved; I set both sites to PHP 5.4, and for both port 587 with TLS (thanks for the tip, I just took what the ISP gave me with 465/SSL..). This seems to be doing the trick for the time being and works consistently. Somehow it doesn't like PHP5.6 or 7.

I also take the opportunity to say I am a long time Imagevue user and super happy with X3. And if you want to book a nice holiday flat in the Swiss Mountains, check this one (www.polaschin.ch) out and I get you a good rate :D !
 
User avatar
Martin
Experienced
Posts: 651
Joined: 30 Jan 2011, 23:24

Re: Contact Form / Unable to send mail

22 May 2016, 14:18

ckishappy wrote:... And if you want to book a nice holiday flat in the Swiss Mountains, check this one...
Nice site!
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14452
Joined: 30 Sep 2006, 03:37

Re: Contact Form / Unable to send mail

22 May 2016, 14:39

ckishappy wrote:I also take the opportunity to say I am a long time Imagevue user and super happy with X3. And if you want to book a nice holiday flat in the Swiss Mountains, check this one (http://www.polaschin.ch) out and I get you a good rate :D !
:D Might have to take you up on that offer some time!