Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1549 2015-11-20 10:50:56

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.20

If you paste this into a new file, upload it to the server and then visit that page, does that send an email and which message is shown in the browser?

<?php 

$to_address = "your.email@address.com";
$subject = "test mail";
$body = "test mail";

echo mail($to_address, $subject, $body) ? "Email sent" : "Failed!";

Offline

#1550 2015-11-20 11:26:26

catnip
Member
From: Sydney Australia
Registered: 2006-07-29
Posts: 58
Website

Re: zem_contact_reborn 4.0.3.20

Hi Rudd, I’ve put the code into a test.php, uploaded it and visited the page. I don’t get a form – I get:

Warning: mail(): Multiple or malformed newlines found in additional_header in [[actual path removed from the quote by me]] on line 8
Failed!

Offline

#1551 2015-11-20 12:33:26

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.20

Code updated in previous post. Try again please.

Offline

#1552 2015-12-17 22:33:13

catnip
Member
From: Sydney Australia
Registered: 2006-07-29
Posts: 58
Website

Re: zem_contact_reborn 4.0.3.20

HI Rudd, the message I get is “Email sent” and I do actually receive the email.

What does that mean?

ruud wrote #296706:

If you paste this into a new file, upload it to the server and then visit that page, does that send an email and which message is shown in the browser?

<?php...

p.

Offline

#1553 2015-12-18 17:58:32

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.20

It means that PHP can send email without any special measures, which is good.

If possible, try sending an email through the contact form, write down the exact date/time (seconds included) and ask the IT people to look in the server logs. Should be easy to find, if they have the from/to email address and timestamp.

Otherwise, edit the plugin and before this line:

if (mail($to, $subject, $msg, $headers))

add:

$to = "your.email@address.com";
$msg = "test mail";
$body = "test mail";
$headers = "";

With all 4 lines added, you should receive the same mail that you got with the little test script you tried in my previous post. Assuming that works, try removing one of those 4 lines. Test again. Remove another line. Test again. At some point it stops working. Add back the line that makes it work and remove one of the other remaining lines. That way you should be able to find out which part of the email causes it to malfunction.

Offline

#1554 2015-12-18 21:25:56

catnip
Member
From: Sydney Australia
Registered: 2006-07-29
Posts: 58
Website

Re: zem_contact_reborn 4.0.3.20

Thanks Rudd,

I appreciate your continued effort to help me resolve this.

I couldn’t find the line you suggested in v4.5.0.0 so uninstalled it and reinstalled v4.0.3.20

I’m afraid that after adding these four lines where you suggested (and changing the first line to my address) using the contact form has not resulted in me getting any email.

:(

Offline

#1555 2015-12-19 12:51:01

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.20

Two options:
  • consult the IT people, who should be able to find something in the mail server logs.
  • give someone here admin access to TXP on your website to diagnose the problem (I can have a look if you want, send me an email).

PS. it’s Ruud, not Rudd ;)

Offline

#1556 2015-12-19 14:31:36

catnip
Member
From: Sydney Australia
Registered: 2006-07-29
Posts: 58
Website

Re: zem_contact_reborn 4.0.3.20

Hi Ruud,
Just dropped you an email.
Apologies for my dyslexia.

~ j

Offline

#1557 2015-12-20 11:32:48

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: zem_contact_reborn 4.0.3.20

In case anyone else has the same problem… what caused mail delivery to fail for catnip was a mailserver that somehow filtered out email sent by eval()’d PHP code such as plugins that are loaded via the plugins tab.

The solution was to set a plugin cache directory in the TXP preferences and put the ZCR plugin code in there. That way, the code is included instead of eval()’d, thus circumventing the filtering mechanism at the mailserver.

Offline

#1558 2016-01-12 00:28:13

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: zem_contact_reborn 4.0.3.20

Hey – has anyone managed to get a virtual pageview in Google Analytics working on form submit?

I have checked a few sites for setting up virtual pageview and have come up with the following code… but I can’t seem to get it to work :(

Can anyone more skilled in firing javascript code take a quick look or help me out please :)

$(document).ready(function() {
  $('.zemContactForm').submit(function() {
	//ga('send', 'pageview', '/uthanks.html');
	ga('send', { 'hitType': 'pageview', 'page': '/uthanks.html', 'title': 'Contact us submitted' });
  });
});

Last edited by tye (2016-01-12 04:43:52)

Offline

#1559 2016-01-13 06:26:26

peterj
Member
From: Melbourne, Australia
Registered: 2005-06-02
Posts: 99

Re: zem_contact_reborn 4.0.3.20

Thanks Ruud for your cache tips above. I was having the same problem.

Disabled the plugin, made a php file and uploaded using handy instructions here:
http://www.textpattern.net/wiki/index.php?title=Plugin_Template

//
Tye – not familiar with GA virtual page views, but (and this may be stating obvious), has google js loaded prior, and is Inspector throwing any js errors?

Regards
Peter

Offline

#1560 2016-01-13 23:53:14

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: zem_contact_reborn 4.0.3.20

Thanks Peter – it wasn’t that, it was me over thinking – if anyone wants to setup Google Analytics Goals using zem_contact_reborn without a thankyou page – then after setting up the Goal in Google Analytics, use the following to send a virtual page view – change /uthanks.html to whatever virtual page you like

$('.zemContactForm').submit(function() {
	ga('send', 'pageview', '/uthanks.html');
  });

Offline

Board footer

Powered by FluxBB